Hi, I would appreciate it if somone can help me with this script....
Fisrtly please look at my if/ else statements what i want to achieve is if (submit)
look at query1 if no id_number provided look at query2...
secondly.... query2 needs to be able to select more than one prop_ID and set it as a variable that can be echo-ed via $_SESSION on another page.....
if(isset($_POST["Submit"]))
{
$prop_ID_tmp = $_POST["id_number"];
$query = "SELECT prop_ID FROM right_prop_1 WHERE prop_ID = '$prop_ID_tmp'";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$prop_ID = $row["prop_ID"];
}
if (mysql_num_rows($result) == 1)
{
$_SESSION['prop_ID'] = $prop_ID;
header ("location: prop_manager/prop_list_num_result.php");
exit();
}
$sale = $_POST["sale"];
$query2 = "SELECT prop_ID FROM right_prop_1 WHERE sale ='$sale'";
$result2 = mysql_query($query2) or die(mysql_error());
while ($row = mysql_fetch_array($result2, MYSQL_ASSOC)) {
$prop_ID = $row["prop_ID"];
if (mysql_num_rows($result2) == 1)
{
$_SESSION['prop_ID'] = $prop_ID;
header ("location: prop_manager/prop_result.php");
exit();
}
}
}