Advertisement
Guest User

php - mysql Problem

a guest
Jul 17th, 2015
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. Notepad++
  2. -------------------
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6.     <title>mysql-Verbindung</title>
  7. </head>
  8. <body>
  9.     <h1>mysql-Verbindung</h1>
  10.     <?php
  11.     mysqli_connect("mhost", "bname", "pass") or die(mysqli_error());
  12.     mysqli_select_db("db") or die(mysqli_error());
  13.    
  14.     $sql = "SELECT * FROM test1";
  15.     $query = mysql_query($sql) or die(mysqli_error());
  16.    
  17.     echo '<table>';
  18.         while($fetch = mysql_fetch_assoc($query)){
  19.             echo '<tr></tr>';
  20.         }
  21.     echo '</table>';
  22.  
  23.     ?>
  24. </body>
  25. </html>
  26.  
  27.  
  28.  
  29. Browser:
  30. -------------------------
  31. mysql-Verbindung
  32.  
  33. '; while($fetch = mysql_fetch_assoc($query)){ echo ''; } echo ''; ?>
  34.  
  35. --------------------------
  36. http://puu.sh/j2sW3/291f0b7c4e.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement