jaymc Posted October 21, 2006 Share Posted October 21, 2006 $x = mysql_query($z);if $x is going to contain 5 rows of info, how can I check to see what the ID field is equal to of each row without doing a mysql_fetch_array/assoc Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/ Share on other sites More sharing options...
wildteen88 Posted October 21, 2006 Share Posted October 21, 2006 You cant, As $x stores the result resource of the query ($z). It holds nothing else. In order get the information form the result resource you need to pass $x to another mysql_*() function to process the result resource. Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/#findComment-112335 Share on other sites More sharing options...
jaymc Posted October 21, 2006 Author Share Posted October 21, 2006 What other functions can I use, apart from assoc and arrayThey are conflicting with my script esecpaily if in a while loop Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/#findComment-112372 Share on other sites More sharing options...
kenrbnsn Posted October 21, 2006 Share Posted October 21, 2006 What do you mean by [quote]They are conflicting with my script esecpaily if in a while loop[/quote]Please post the source of your script.Ken Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/#findComment-112373 Share on other sites More sharing options...
jaymc Posted October 21, 2006 Author Share Posted October 21, 2006 For the while to work I have to run the same query twice $runquerya = mysql_query($querya); $runqueryb = mysql_query($querya);And use each in the 2 while loops Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/#findComment-112388 Share on other sites More sharing options...
redarrow Posted October 21, 2006 Share Posted October 21, 2006 Post your full code ok cheers. Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/#findComment-112393 Share on other sites More sharing options...
Psycho Posted October 21, 2006 Share Posted October 21, 2006 Running the same query twice is ill advised as it is possible for information to change between the two instances and that could cause problems. You should run the query once then dump the values into an array. Quote Link to comment https://forums.phpfreaks.com/topic/24661-fetch-row-elements-from-an-array/#findComment-112418 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.