Advertisement
Guest User

Untitled

a guest
May 15th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2.  
  3. $host = "localhost"; // your host name
  4. $username = "root"; // your user name to access MySql
  5. $password = ""; // your password to access MySql
  6. $database = "hvware"; // The name of the database
  7.  
  8. //$link = mysql_connect($host,$username,$password);
  9. if (!$link = @mysql_connect($host,$username,$password,true))
  10. {die('Could not connect:'. mysql_error()); }
  11.  
  12. @mysql_select_db($database) or die( "Unable to select database");
  13. $sql="SELECT * FROM testblob2";
  14.  
  15. $result = mysql_query($sql);
  16. if (!$result) {
  17. die('Invalid query: ' . mysql_error());
  18. }
  19.  
  20. while($row=mysql_fetch_assoc($result)){
  21. echo $row['dealname'].", ";
  22. echo $row['price'].", ";
  23. echo $row['descrip'].", ";
  24. echo $row['image_id']."<br>";
  25.  
  26. }
  27. mysql_free_result($result);
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement