Guest User

Untitled

a guest
Jul 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2. /* Programme : mysql_up.php
  3. * desc : Se connecter au serveur mysql
  4. * et affiche les paramètres.
  5. */
  6.  
  7. echo "<html>
  8. <head><title>Test de MySQL5 avec php5</title></head>
  9. <body>";
  10. $host="localhost";
  11. $user="user";
  12. $password"="password";
  13. $cxn = mysqli_connect ($host , $user , $password);
  14. $sql="SHOW STATUS";
  15. $result = mysqli_query($cxn,$sql);
  16. if($result == false)
  17. {
  18. echo "<h4>Erreur : ".mysqli_error($cxn). "</h4>";
  19. }
  20. else
  21. {
  22. /* tableau affichant les résultats */
  23.  
  24. echo "<table border='1'>
  25. <tr><th>Nom_Variable</th>
  26. <th>Valeur</th></tr>";
  27.  
  28. for($i = 0; $i <mysqli_num_rows($result); $i++)
  29. {
  30.  
  31. echo "<tr>";
  32. $row_array = mysqli_fetch_row($result);
  33.  
  34. for($j = 0;$j <mysqli_num_fields($result);$j++)
  35. {
  36. echo "<td>" .$row_array[$j]."</td>\n";
  37. }
  38. }
  39. echo "</table>";
  40. }
  41. ?>
  42. </body>
  43. </html>
Add Comment
Please, Sign In to add comment