php mysql query issues

Codes here !

Moderators: macek, egami, gesf

Post Reply
NigelRen
php-forum Fan User
php-forum Fan User
Posts: 610
Joined: Fri Aug 05, 2011 9:53 am

Re: php mysql query issues

Post by NigelRen » Wed Sep 19, 2012 11:00 pm

One thing which will probably cause odd results is
//get category descriptions

Code: Select all

$categories_description_results = mysql_query("SELECT `categories_id`, `categories_name` FROM `categories_description` WHERE `categories_id` = '$categories_results[categories_id]'") or die(mysql_error());
When you want to access the results of a query - you have to use quotes round the name of the field - which is what you did later, but not in this query. Try changing it to something like
//get category descriptions

Code: Select all

$categories_description_results = mysql_query("SELECT `categories_id`, `categories_name` FROM `categories_description` WHERE `categories_id` = '".$categories_results['categories_id']."'") or die(mysql_error());

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests