For some time I discovered how to make a connection between a PHP document (script) and a MySQL database. To create dynamic sites that write and read a database is needed to introduce  into a PHP file that creates a connection between the two of them. This is a used predefined PHP function mysql_connect and can be invoked whenever we need a connection to a database.
There is a need to define the following variables:
localhost = server where the database is stored. Usually this variable is denoted with localhost as the database is on the same server as the website.
mysql_user = user with access to a database that we care. This user must have write access, delete and modify the data contained in the database.
mysql_password = user password required to connect to the database.
The syntax of connection is then arranged as in the example below:
Note that if the connection is not made ​​an error message appears and if the connection is made ​​the message “Successfully Connected”.
I will return and other aspects of the types of connections.
8 comments
Skip to comment form
I love the theme on this blog. Is it downloadable anywhere?
Author
Yes … You can find this theme here : http://www.themelab.com/2009/09/03/jungleland-free-wordpress-theme/
or here:
http://www.styleshout.com/
Preview here : http://www.styleshout.com/templates/preview/Jungleland10/index.html
Machine translation failed. retry
Author
Machine translation failed. retry
great blog man, I really admire your writing style that you are using for your posts and stuff, really hollywood…
Machine translation failed. retry
lool!! this is a great idea! 😀
Machine translation failed. retry