![]() |
||||||||||||||||||||||||
| Home --- Topics --- Articles --- Offers --- Register --- Contact us | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Did you know? if you register at Hamid School you can save up to 45% on hosting packages offered by Surreyhost.com . Don't miss out, every minute counts! Are you Confused? Click here to learn how to use hamid school PHP MySQL Connect to a DatabaseThe free MySQL Database is very often used with PHP. Connecting to a MySQL DatabaseBefore you can access and work with data in a database, you must create a connection to the database. In PHP, this is done with the mysql_connect() function. Syntax
Note: There are more available parameters, but the ones listed above are the most important. Example In the following example we store the connection in a variable ($con) for later use in the script. The "die" part will be executed if the connection fails:
Closing a ConnectionThe connection will be closed as soon as the script ends. To close the connection before, use the mysql_close() function.
Viewed:538 Original Author: W3school however, some changes have been made to the main contents.
Did you know? if you register at Hamid School you can learn web programming and designing for free and also you can save up to 45% on hosting packages offered by Surreyhost.com . Don't miss out, every minute counts!
|
|
|||||||||||||||||||||||
|
Sponsored by: Surreyhost.com Coded and designed by: Hamid Moudi HPLA Follow us: ![]() ![]() |
||||||||||||||||||||||||