I have a search page set up. It is basically a text field and a submit button. I dont know how to do this, so I will post what I have so far. I know that it is probably all wrong, see how close I am and see if you can get me going in the right direction.
Here is my form:
<form name="ticket_number_search" method="post" action="search_script.php">
<strong><font color="#FF0000" size="3" face="Arial, Helvetica, sans-serif">Enter
your ticket number: </font></strong>
<input type="text" name="ticket_number_search"><br><br>
<input type="submit" name="Search" value="Search">
</form>
I think that I have the form done right, but I dont know the slightest as to how to grab the values from the textfield and have my select statement pull the correct data. I have the action set to use search_script.php. This is where I am most confused.
Here is what I have. Like I said earlier, I know this is wrong. I am confused:
<?
$username="root";
$password="";
$database="tracker";
$server="localhost";
mysql_connect($server,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM request where timestamp LIKE %ticket_number_search%";
$result=mysql_query($query);
echo "
$result
";
//print errors if any on page
echo mysql_error();
mysql_close();
?>
I am using timestamp from the database as a ticket number on the page.