Forum Moderators: coopster

Message Too Old, No Replies

Issues with Image Gallery

         

hybridcoder

5:07 pm on Feb 5, 2010 (gmt 0)

10+ Year Member



I am using PHP to connect to a DB and than retrieve data and display it, and I am getting this error.

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

I'm trying to follow a tutorial from a respected web design/development site yet I ran into this road bump.

Any help would be greatly appreciated




$result = mysql_query( "SELECT category_id,category_name FROM gallery_category" );
while( $row = mysql_fetch_array( $result ) )
{
$photo_category_list .=<<<HTML
<option value="$row[0]">$row[1]</option>\n
HTML;
}
mysql_free_result( $result );

hybridcoder

5:20 pm on Feb 5, 2010 (gmt 0)

10+ Year Member



I added "or die(mysql_error());" after my query and figured it out.