I have a total 'blank' on this one. Something which I normally get my head around in moments. However, right now this really simple and embarrassing problem has beat me !

To explain...
I have created a PHP form that requires two inputs in order to pull a product correctly from a database. This works fine. That is to say. 'IF' I enter the both inputs 'correctly', then obviously, I get a good reply !!
However, (and this is the embarrassing bit). I can not sort out how to check if -
1) A user enters nothing. This is an error, how do I test for this?
2) A user enters both inputs but one or both are not correct, so database match. How do I say this?
Something like -
check input1 and input2...
IF input = nothing {
report error, invite user try again..
}
else
IF input input1 and or input2 <> any database match {
report error, invite user try again..
}
I assume if input1 and input2 are correct, program continues to next processing stage...
The form inputs from form.php are -
$searchName = $_GET['keyname'];
$searchDate = $_GET['keydate'];
And the SQL term used in search mysql database via a php script called search.php is -
Code: Select all
$search = $_POST['Search'];
$sql = mysql_query("SELECTstock.Product_SKU,
stock.Product_Colour,
stock.Product_Supply,
stock.Product.Size
stock.Instock_Date
FROM
stock
WHERE
stock.Product_SKU, = '$searchName' AND
stock.Instock_Date_Date = '$searchDate'");
I should know this. But it's early hours in the morning GMT and my brain is dead all but the reality. ANY help would be VERY welcome..