<?php $username = "infadesign"; $password = "Mistainfa1"; $hostname = "208.112.101.236";
//connection to the database $connectMe = mysql_connect($hostname, $username, $password) or die("Hey Rob, Unable to connect to MySQL"); //select a database to work with $selected = mysql_select_db("infadesign",$connectMe) or die("Hey Rob, cound not select examples" . mysql_error()); ?> <br /><br /> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php //execute the SQL query and return records $result = mysql_query("SELECT * FROM Family", $connectMe); //fetch tha data from the database while ($row = mysql_fetch_array($result)) { echo $row{'fname'} ." ".$row{'Lname'} ." " .$row{'Email'} ." ".$row{'Age'}. "<br>"; } //close the connection mysql_close($connectMe); ?> </body> </html> |