Welcome to WebmasterWorld Guest from 220.127.116.11
The problem: I have a PHP form that queries a local MySQL database and returns a (fairly large, in some cases) dynamically generated page (think 500 school listings - max). There are a number of fields that $_POST their values to the results page, and I double checked to make sure all the defaults options are marked: selected="selected".
It works fine with any combination of search criteria I can think of, EXCEPT leaving everything on the defaults. The result there is that 1) it queries MySQL properly and logs the proper number of results in the database, which leads me to believe that $_POST is working just fine.
BUT - it refuses to display the results. It renders part of the page, stopping at a dynamic piece just above where it would be processing the results.
The results set with all defaults is, as you might expect, the largest, but this was working fine until today. Other things that happened - moved to a new VPS yesterday (new Apache/PHP/MySQL, but I think all are up to date), added some data to the database and moved some fields around (but no obvious relation to the query in this case).
It is still capturing the default criteria and using them to search MySQL just fine, but it won't display the results.
Any ideas?..... this issue may be part HTML as well.... not sure.
If you have re-ordered the fields, make sure the SQL query reflects the order.
When having a problem like this, I often take out the SQL part and put it into a seperate file. Test the two parts independently. See if it's the HTML or the PHP that's messing things up.
Another trick I use is to 'comment-out' all the PHP lines and then un-comment them one at a time until it stops working. Then you have found the line with the problem.