scootstah Posted April 13, 2012 Share Posted April 13, 2012 Yeah, that's what I figured. You're only looping over one result in the while loop each time, so there will only ever be one table row. In order for this to work you either need to move the logic to the for loop or change the queries so that you are getting all of the rows at once. Honestly, you need to go through that whole chunk of code and re-write it. You have a lot of queries inside loops inside loops inside loops. Quote Link to comment https://forums.phpfreaks.com/topic/260259-display-data-from-mysql/page/2/#findComment-1337003 Share on other sites More sharing options...
microbert Posted April 13, 2012 Author Share Posted April 13, 2012 I really appreciate your help on this one, I have tried to modify some code but nothing is working. can you please give me an idea of how I need to change the while loop to display more than one result? Quote Link to comment https://forums.phpfreaks.com/topic/260259-display-data-from-mysql/page/2/#findComment-1337017 Share on other sites More sharing options...
scootstah Posted April 13, 2012 Share Posted April 13, 2012 You can't change the while loop to display more than one result, because you're only getting one row from the query. Quote Link to comment https://forums.phpfreaks.com/topic/260259-display-data-from-mysql/page/2/#findComment-1337098 Share on other sites More sharing options...
microbert Posted April 13, 2012 Author Share Posted April 13, 2012 So can you please tell me how can get more than one row from the query, because I am really stuck and can't find a solution. Quote Link to comment https://forums.phpfreaks.com/topic/260259-display-data-from-mysql/page/2/#findComment-1337200 Share on other sites More sharing options...
litebearer Posted April 14, 2012 Share Posted April 14, 2012 what is the value of $pieces[$i] and how many records in your table have that value? Quote Link to comment https://forums.phpfreaks.com/topic/260259-display-data-from-mysql/page/2/#findComment-1337219 Share on other sites More sharing options...
microbert Posted April 14, 2012 Author Share Posted April 14, 2012 $pieces is the data from the mysql field. this field it is has the item codes of the related items and they are seperated with a ";" in the one that I am testing it have 8 items. for example in the mysql filed it is as "code01;code02;code03;code04;code05;code06;code07;code08" Quote Link to comment https://forums.phpfreaks.com/topic/260259-display-data-from-mysql/page/2/#findComment-1337295 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.