开发者

MySQL select all missing a record

  1. I have added a new record to a table using phpMyAdmin
  2. I then run select *开发者_如何学Python within phpMyAdmin and it works listing all records.
  3. However if run the same select * from a PHP page the new record is missing.

I am using PHP 5 and am not sure what is going on here. It used to work in PHP 4.

.php files run as PHP 5 Apache module mode.


Here are a few things you can investigate:

  • You could be connecting to a different database from the one you think you are (do you have test and production databases?).
  • You may have an error or typo in your SELECT statement. Copy and paste exactly the query that works into your code. Do not manually edit it afterwards.
  • You might select the row correctly but display it incorrectly so that it appears not to be there. Try checking how many rows there are in your result set.


Try put sql query to variable and then dump it to log or use var_dump. Then put query to phpMyAdmin and check errors.


Thanks for the answers but found out the answer now.

I had bookmarked a link to an older phpMyAdmin server which looked almost identical and allowed me to log in etc. My host should have forwarded me to the latest server.

I am now using the correct server. Hope this helps someone else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜