Guest User

Untitled

a guest
May 26th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. $link = mysql_connect('localhost', 'root', 'password');
  4.  
  5. if (!$link) {
  6. die('Could not connect: ' . mysql_error());
  7. }
  8.  
  9. mysql_select_db("ct366", $link);
  10.  
  11. $criteria = $_GET[partial];
  12.  
  13. //$sql = "select * from hf_tag where keyword like '%$criteria%'";
  14. $sql = "select * from real_estate where name = '$criteria'";
  15. //echo "$sql";
  16.  
  17. $result = mysql_query( $sql, $link );
  18. //echo "$result";
  19.  
  20. while( $myrow = mysql_fetch_row($result) )
  21. {
  22. $bedrooms = "<tr><td>$myrow[1]</td></tr>";
  23. $bathrooms = "<tr><td>$myrow[2]</td></tr>";
  24. $price = "<tr><td>$myrow[3]</td></tr>";
  25. }
  26.  
  27. mysql_close($link);
  28.  
  29. //echo $bedrooms;
  30. echo $bathrooms;
  31. echo $price;
  32. ?>
Add Comment
Please, Sign In to add comment