Hi
I have two search boxes with one submit button
I want one search box to search one table in my database and the other search box to search another table in my database
Then If there is a match between the two I want the results to be displayed
THANKS!
James
I have two search boxes with one submit button
I want one search box to search one table in my database and the other search box to search another table in my database
Then If there is a match between the two I want the results to be displayed
THANKS!
James
Code:
<form action="today.php" method="post">
<input type="text" name="search">
<input type="text" name="search2">
<input type="submit">
</form>
<hr width="100%"></hr>
<?php
if(strlen(trim($_POST['search'])) > 0) {
//all of your php code for the search
$search = "%" . $_POST["search"] . "%";
mysql_connect ("", "", "");
mysql_select_db ("");
if (!empty($_POST["search_string"]))
{
}
$query = "SELECT title,location,msg FROM job_tit,job_loc WHERE (job_title.msg_id=job_loc.msg_id)";
$result = mysql_query ($query);
if ($result) {
while ($row = mysql_fetch_array ($result)) {
echo "<br>$row[0]<br/>";
echo $row[1];
echo "<br>$row[2]<br/><br><br/>";
}
}
}
?>
</body>
</html>
Comment