Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. $username = "xxxxxxxx";
  3. $password = "xxxxxxxx";
  4. $hostname = "localhost";
  5.  
  6. //connection to the database
  7. $dbhandle = mysql_connect($hostname, $username, $password)
  8.  or die("Unable to connect to MySQL");
  9. echo "Connected to MySQL<br>";
  10.  
  11. //select a database to work with
  12. $selected = mysql_select_db("alcoholr_forminfo",$dbhandle)
  13.   or die("Could not select forminfo");
  14.  
  15. //execute the SQL query and return records
  16. $result = mysql_query("SELECT * FROM FormData");
  17.  
  18. //fetch tha data from the database
  19. while ($row = mysql_fetch_array($result)) {
  20.    echo "<br />ID:".$row{'ID'}."<br /> Name:".$row{'Name'}."<br /> Email:".$row{'Email'}."<br />
  21.    Phone:".$row{'PHON'}."<br /> State:".$row{'State'}."<br /> Comments:".$row{'Comments'}."<br />";
  22. }
  23. //close the connection
  24. mysql_close($dbhandle);
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement