I am trying to use a form to retrieve data from database based on the values that are selected from the fields. I dont think I have problems with the form itself, but the php is giving me a hard time.
heres the form url: http://www.onedispatch.com/test/loadsearch.html
heres the php code:
<?php
$conn = mysql_connect("mysql18.ixwebhosting.com","username","password");
mysql_select_db("jarodd_currentloads",$conn);
$query="SELECT * FROM loads_now WHERE origin_state='$_POST[origin_state]',origin_area='$_POST[origin_area]',dest_state='$_POST[dest_state],dest_area='$_POST[dest_area]'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i<$num){
$originstate=mysql_result($result,$i,"OriginState");
$originarea=mysql_result($result,$i,"OriginArea");
$deststate=mysql_result($result,$i,"DestState");
$destarea=mysql_result($result,$i,'DestArea");
echo "<b>$originstate</b><b>$originarea</b><b>$deststate</b><b>$destarea<b>";
$i++;
}
?>
[code=php]