PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Been having issues all night with a bunch of my code and files and am getting really angry, but this one is one I'm most confused about.
It returns a blank page. Turning on error reporting for PHP and for MySQL shows nothing unless I purposefully make something wrong, but leaving it as is just gives me a blank page. What gives?
a good method to determine if the page is failing to load at all ie PHP error or if your results just aren't coming back as expected..
create a title tag in the head and give it a value. If the page parses then your title will show, if you have a PHP error you will not even see the title.
OK, that means your query is running since your not getting the DIE message but no results.
Try echoing out random text in different places such as before the while loop, in the while loop, and after the while loop to see what works and what doesn't.
astions wrote:How about turning on error reporting so you don't have to "guess" at what the issue is. Put this at the top of your code and post the results please.
divito wrote:Been having issues all night with a bunch of my code and files and am getting really angry, but this one is one I'm most confused about.
It returns a blank page. Turning on error reporting for PHP and for MySQL shows nothing unless I purposefully make something wrong, but leaving it as is just gives me a blank page. What gives?
I have full tags in the actual file, I just used the short one when I pasted some the code here. My site has no issue with short tags though. And I changed the function to lower case as requested; was just like that from an old tutorial so I always just copied it over.
I managed to fix it. I moved the include for the db connection after the function and it magically started working. Anyone have an explanation for that one?