Trying to search via two tables, this is what i have and i know the IF is wrong as you cannot do what i thought/hoped.
any help?
[php]<?php
session_start();
$conn = mysql_connect(“localhost”, “***”, “***”);
mysql_select_db("***");
//search customer_db table
$cust = $_POST [“cust_name”];
$siten = $_POST [“site_name”];
$siteid = $_POST [“site_id”];
$postc = $_POST [“post_code”];
//search job_db
$ord = $_POST [“ord_no”];
$task = $_POST [“task_name”];
$conn = mysql_connect(“localhost”, “***”, “***”);
mysql_select_db("***");
$mysql = "";
if ($cust, $siten, $siteid, $postc, $ord, $task != "")
{
$mysql = "SELECT * FROM customer_db, job_db WHERE = '$cust', '$siten', '$siteid', '$postc', '$ord', '$task'";
$result = mysql_query($mysql);
if (mysql_num_rows($result)==0)
{
echo "Sorry there are currently 0 $searchby event types currently scheduled.<br/>";
}
else
{
echo "<table width='100%' border='1'>";
echo "<tr>";
echo "<td>Customer Name</td>";
echo "<td>Site Name</td>";
echo "<td>Site ID</td>";
echo "<td>Post Code</td>";
echo "<td>Order Number</td>";
echo "<td>Task Name</td>";
echo "</tr>";
}
{
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>$row[cust_name]</td>";
echo "<td>$row[site_name]</td>";
echo "<td>$row[site_id]</td>";
echo "<td>$row[Post_code]</td>";
echo "<td>$row[ord_no]</td>";
echo "<td>These are your selected results</td>";
echo "</tr>";
}
}
{
echo "</table>";
}
}
mysql_close($conn);[/php]