简体   繁体   中英

MySQL select all missing a record

  1. I have added a new record to a table using phpMyAdmin
  2. I then run select * 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM