I am a beginner in php, i have created a search form that i want to pull results from my mysql DB, problem is upon submitting it redirects to an HTTP 500 error. here are the scripts…
HTML search Form:
<html>
<body>
<form action="searching.php" method="GET">
Search For:
<br>
address:<input name="address" type="text" size="25"> <br>
direction:<select name="direction">
<option value=""> </option>
<option value="N">North</option>
<option value="NE">North East</option>
<option value="E">East</option>
<option value="SE">South East</option>
<option value="S">South</option>
<option value="SW">South West</option>
<option value="W">West</option>
<option value="NW">North West</option>
</select> <br>
street:<input name="street" type="text" size="25"><br>
suffix:<input name="suffix" type="text" size="25"><br>
city:<input name="city" type="text" size="25"><br>
state:<input name="state" type="text" size="2"><br>
<input type=submit value="Search">
</form>
</body>
</html>
The searching.php file:
[php]
<?php $con = mysql_connect("xxxx","xxxxx","xxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("metertrackers", $con);$RESULT = MYSQL_QUERY "SELECT address, direction, street, suffix, city, state FROM dataentry
WHERE 1 LIMIT 0, 30 “;
VALUES
(’$_GET[address]’, ‘$_GET[direction]’, ‘$_GET[street]’, ‘$_GET[suffix]’,’$_GET[city]’, ‘$_GET[state]’)”;
if ($row = mysql_fetch_array($result) {
do {
print $row[“address”];
print (" “);
print $row[“direction”];
print (” “);
print $row[“street”];
print (” “);
print $row[“suffix”];
print (” “);
print $row[“city”];
print (” “);
print $row[“state”];
print (”
");
} while($row = mysql_fetch_array($result));
} else {print “No Results found, Try again later.”;}
?>
If someone could look over it and see where the problem is, or if this is even gonna work. thank you, any advice is greatly appreciated.
( mysql login information was intentionally 'xxxx’ed)