Ok here is the code.
global $conn;
$strSQLExists = "select * from items where barcode='".$data["barcode"]."'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
echo "Item Is in DataBase";
}
else
{
header("Location: items_add.php");
exit();
}
I am using this on the List page: after record is processed
What i want it to do is when i enter a search value and it does not exist in the database to send me to the items_add.php page
I can get it to Echo "item is in database" at the top of the page when i enter a known DB entry but when i search a value that i know isn't in the DB it just says it normal "no records found" and will not process the else statement at all, I've tried every why i know how but i cant get this to go.
any ideas would be greatly appreicated
Junior