Skip to content
Advertisement

Using PHP/MYSQL book but get no output from PHP when trying to access the database

I’m currently working my way through “PHP and MySQL Web Development.” I’ve successfully created databases and been able to make tables and use the database. I’ve also successfully completed all the chapters on PHP and have had no problems with PHP not working up to this point. The goal of this page is return search results from a database. It’s a pretty simple thing to do but for some reason nothing is being output from the script to the page. I’m getting no errors or anything. It’s just blank with the title at the top. Can anyone please help me out with this? Thank you.

Here is the PHP code:

JavaScript

Advertisement

Answer

You’re supressing the errors from the line:

JavaScript

Thats what the @ sign does, remove the @ sign and verify that the connection works properly, it might be that your script fails there.

You shouldn’t use that, it’s not considered good practice as far as I know.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement