Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Programme : mysql_up.php
- * desc : Se connecter au serveur mysql
- * et affiche les paramètres.
- */
- echo "<html>
- <head><title>Test de MySQL5 avec php5</title></head>
- <body>";
- $host="localhost";
- $user="user";
- $password"="password";
- $cxn = mysqli_connect ($host , $user , $password);
- $sql="SHOW STATUS";
- $result = mysqli_query($cxn,$sql);
- if($result == false)
- {
- echo "<h4>Erreur : ".mysqli_error($cxn). "</h4>";
- }
- else
- {
- /* tableau affichant les résultats */
- echo "<table border='1'>
- <tr><th>Nom_Variable</th>
- <th>Valeur</th></tr>";
- for($i = 0; $i <mysqli_num_rows($result); $i++)
- {
- echo "<tr>";
- $row_array = mysqli_fetch_row($result);
- for($j = 0;$j <mysqli_num_fields($result);$j++)
- {
- echo "<td>" .$row_array[$j]."</td>\n";
- }
- }
- echo "</table>";
- }
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment