Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member ThePhoenix2006's Avatar
    Join Date
    Mar 2005
    Location
    Michigan
    Posts
    88
    Member #
    9431
    Hi everyone,

    Well I thought I was on a roll but I guess it caught up to me.

    For some reason I get this error:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in...

    Here is the code piece that supposeable doesnt work.

    PHP Code:
    $results mysql_query("SELECT * FROM artists ORDER BY $field $order LIMIT $page$limit");
    while(
    $row mysql_fetch_array($resultsMYSQL_ASSOC)) 
        { 
    Is there anything wrong? I am trying to have a form submit via "<?php echo $PHP_SELF;?>"

    Would that give me this headache?
    "Make sure the juice is worth the squeeze" ~The Girl Next Door

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Your query is probably failing, and is not returning a valid resource identifier.

    Try to add an error checker to your query:
    PHP Code:
    $results=mysql_query("your query") or die(mysql_error()); 
    S. Rosland

  4. #3
    Member ThePhoenix2006's Avatar
    Join Date
    Mar 2005
    Location
    Michigan
    Posts
    88
    Member #
    9431
    Well that changed the error.

    Now I get "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 10' at line 1"
    "Make sure the juice is worth the squeeze" ~The Girl Next Door

  5. #4
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Good, then we've established that it's your query that fails.

    It's hard to evaluate your query with all of its body made up of variables.
    Try to echo out your query, and post the actual query string here.

    PHP Code:
    $sql "SELECT * FROM artists ORDER BY $field $order LIMIT $page$limit";

    echo 
    $sql."<br />"//Copy and paste the screen output here.

    $results mysql_query($sql) or die(mysql_error()); 
    S. Rosland

  6. #5
    Member ThePhoenix2006's Avatar
    Join Date
    Mar 2005
    Location
    Michigan
    Posts
    88
    Member #
    9431
    I fixed it.

    Thanks for the help!

    :thumbsup:
    "Make sure the juice is worth the squeeze" ~The Girl Next Door


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:01 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com