Thank you,
Joe
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
Code: Select all
<?php
$username="admin";
$password="pass";
$database="read";
$zipcode = $_GET["zip"];
$state = $_GET["state"];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT state,address,city,phone,days,zip FROM labs WHERE zip = '$zipcode'";
//$db_connection = new mysqli("localhost", "admin", "pass", "read");
//$statement = $db_connection->prepare("SELECT zip FROM labs WHERE zip = ?");
//$statement->bind_param("s", $zipcode);
//$statement->execute();
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while ($i < $num) {
$rs=mysql_result($result,$i,"zip");
echo "<b>$rs
$field2-name2</b><br>$field3-name<br>$field4-name<br>$field5-name<hr><br>";
$i++;
}
?>
</html>