Jump to content

[SOLVED] what is the error in this script


jck

Recommended Posts

$rnextcat = mysql_query("SELECT CategoryID from dd_categories WHERE  CategoryID > '$a1[itemCategory]' ORDER by CategoryID DESC LIMIT 1");
$rnc = mysql_fetch_array($rnextcat);
$rncid = mysql_query("SELECT ItemID from dd_items WHERE ItemCategory = '$rnc['CategoryID']' AND ItemStatus = 'approved' ORDER by ItemID DESC LIMIT 1");
$rowncid = mysql_fetch_array($rncid);
$next = $rowncid['ItemID'];

 

to fetch the first item of the next category....... it seems ok but its not worrking

Link to comment
Share on other sites

In the third variable (second mySQL query), you've chnaged the way it's written "...WHERE ItemCategory = '$rnc['CategoryID']' AND...". You need to remove the two innermost quote marks so it reads "..."WHERE ItemCategory = '$rnc[CategoryID]' AND...".

 

Also in the first one you have a double space between "WHERE" and "CategoryID". you need to remove that. If that still doesn't work, tell us what the error message says.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.