![]() |
PHP MySQL Table not loading sometimes
Hi all,
I have been facing this problem from quite sometime. I have to fetch data from a mysql db and display it as a table. This is my code PHP Code:
I suspect the problem is in mysql_fetch_array($result,$con), maybe it is not fetching the data sometimes , thus it is not showing it. Where have I gone wrong ? |
PHP Code:
|
Hi sjaq,
I have DOCTYPE declaration in my original code. It doesn't work even with it. I just posted the code snippet where I was having the problem. Thanks |
Quote:
You're looking for the $result resource var, which is fine, but you don't have a query creating it... |
like allworknoplay said, there is no query being made, so mysql_fetch_array() can't get the results from the array.
another thing, but I am not sure in this, but if you are accessing the the results with the names of the filds, I think you need to use the mysql_fetch_assoc() instead. But i am not sure about that one. |
Quote:
If he's looking for the key/value pair, then yeah he would use array... |
Hey guys,
I used mysql_fetch_object() ... works fine now :) Thanks for the inputs ... they helped me think in the right direction |
| All times are GMT. The time now is 04:53 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0