Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

PHP did not display all my database record, this is my code: while ($info = mysql_fetch_array($req)) { print ""; print "id ".$info['id'].""; print "Name".$info['name'].""; print "start date ".$info['start'].""; print "end date ". $info['end'].""; print "remind days ". $info['remind'].""; print ""; } before this code I just use mysql_num_rows() to know if php reads the records, and its reads them but didn't show them?

OpenStudy (anonymous):

Can you post the code before this? Include the query. And describe the schema if it's not apparent from the query. Also, if you run the query at the mysql client prompt does it return what you expect? Another thing is that you're using th awkwardly. It's going to add a cell for each of those th elements to each row. You should print one row outside this loop with just the headers, then print just the td elements inside the loop. But I don't think that should affect what data is displayed. Are your tr elements going inside a table element? Maybe look at the HTML that's being produced.

OpenStudy (anonymous):

here is my code http://pastebin.com/C3chGyNG I really fixed it out, it seems like the Firefox cache affect my results, I just cleared Firefox cache and then every thing goes well. The funny thing is that I tried to use the (for) loop and the result was a disaster, it print just one DB rows repeatedly.

OpenStudy (anonymous):

I'm not sure I understand. Did you fix it? If not, could you post the HTML that this script produces when you hit the "return" case? And what happened when you ran the query from the mysql client manually?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!