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 Link to comment https://forums.phpfreaks.com/topic/60359-solved-what-is-the-error-in-this-script/ 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. Link to comment https://forums.phpfreaks.com/topic/60359-solved-what-is-the-error-in-this-script/#findComment-300308 Share on other sites More sharing options...
jck Posted July 17, 2007 Author Share Posted July 17, 2007 yes it worked thanks Link to comment https://forums.phpfreaks.com/topic/60359-solved-what-is-the-error-in-this-script/#findComment-300318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.