How do I connect to mySQL from PHP?
Luckily there are a couple of functions in PHP that make it easy. Once you get it working you can just copy and paste at the top of each script that requires the database or use a template or include file of some sort to include the details.
$db = mysql_connect("HOST", "USERNAME", "PASSWORD");
And that's all there is to it - use your username, host, password and database name and this will establish the connection.
The most common problem is that you get the password wrong so double check it's right if you get errors.
More mysql PHP Questionshow to write sessions in php code?
How do I find the longest value in my mysql table?
First of all I'm new to php n' mySql . So I just can't figure out what's the wrong in my code. I'm using WAMP and I've created a db named "Try" and in that there is a table named "test". this is my php code and it dosen't give me a
My website www.quicheandpie.com has navigation buttons which were added by going to admin/categorylist and adding a category. I can add category = navigation buttons and update them, but I can not delete them. Any ideas how I can find where the info
Why does this code not work? Returns this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ClaimNo = AND UserName = john' at line 2