jck Posted July 17, 2007 Share Posted July 17, 2007 $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 Quote Link to comment Share on other sites More sharing options...
dooper3 Posted July 17, 2007 Share Posted July 17, 2007 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. Quote Link to comment Share on other sites More sharing options...
jck Posted July 17, 2007 Author Share Posted July 17, 2007 yes it worked thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.