«

Jul
21

How to make a connection with a mySql database by using PHP?

To make a connection with a mySql database :

  1. Use wamp server, to download it click here. Install it.
  2. Start it, left click on the icon in the task bar ( I say left click ;) )  
  3. PHP > PHP Extensions > select php_mysql
  4. In your php page or classe use this code :// mySql connection
    $login_mysqlServer=USER; // your connection user
    $pwd_mysqlServer=PWD’; // password connection user
    $chaine_connexion_mysqlServer = IP_SERVER; // Name or IP of the databasse server
    $bd_mysqlServer=DB_NAME; // Database name
    $con_mysqlServer = mysql_connect($chaine_connexion_mysqlServer, $login_mysqlServer, $pwd_mysqlServer) or die(“Impossible to make connection with  mySQL Server “);
    $selected = mysql_select_db($bd_mysqlServer, $con_mysqlServer) or die(“Impossible to make connection with  mySQL Server “);
  5. Congratulation… You made a connection with your mySql database by using PHP.

 

See also :

 

 

 

Share it with your freinds on Facebook Tweet it to your freinds on Twitter Myspace Friendfeed Technorati del.icio.us Digg Google Yahoo Buzz StumbleUpon

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

WP SlimStat