Guest User

Untitled

a guest
Jan 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. $hostname="localhost";
  2. $username="***";
  3. $password="***";
  4. $dbname="***";
  5.  
  6.  
  7. mysql_connect($hostname,$username, $password) or die ("<html><script language='JavaScript'>alert('Unable to connect to database! Please try again later.'),history.go(-1)</script></html>");
  8. mysql_select_db($dbname);
  9.  
  10. # Check If Record Exists
  11.  
  12. $query = "SELECT * from schools where schools_state=WA ";
  13.  
  14. $result = mysql_query($query);
  15.  
  16. if($result){
  17. while($row = mysql_fetch_array($result)){
  18. $name = $row["$school_name"];
  19. echo "School: ".$school_name."<br/>";
  20. }
  21. }
Add Comment
Please, Sign In to add comment