Test PHP Connection Script
  1. <html>
  2. <head>
  3. <title>Test PHP Connection Script</title>
  4. </head>
  5. <body>
  6.  
  7. <h3>Wsh sa à l'air de marcher</h3>
  8.  
  9. <?php
  10. $dbname = 'Bibliotheque';
  11. $dbuser = 'ruben';
  12. $dbpass = 'Ruben09092001';
  13. $dbhost = 'localhost';
  14. $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to connect to '$dbhost'");
  15. mysql_select_db($dbname) or die("Could not open the database '$dbname'");
  16. $result = mysql_query("SELECT id, name FROM employees");
  17. while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
  18.    printf("ID: %s  Name: %s <br>", $row[0], $row[1]);
  19. }
  20. ?>
  21.  
  22. </body>
Parsed in 0.009 seconds