I get the following error:
Notice: Undefined index: ZNumber in C:\www\htdocs\try.php on line 95
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
My code is as follows:
<?PHP
#when the ZNumber from text box is posted
if (isset($POST['Znumber']))
{
$IDFound = "This is a valid ZNumber and Password";
$IDNotFound = "Either your ZNumber or Password are incorrect. Please try again!";
$Password = "Test1234!";
#first see if both the ZNumber and password are useable
If ($totalRows_Recordset2==1 && $POST['Password']==$Password)
{
echo $IDFound;
#Do the update of videoseen
#1st make the connection
$conn = mysql_connect ('localhost','usr','pwd');
#now select the db
mysql_select_db ("videocheck");
mysql_select_db($database_conn, $conn);
$sqlUpdate = sprintf("Update table1 set videoseen=1 Where ZNumber = ".$_POST['ZNumber']);
$rsUpdate = mysql_query($sqlUpdate, $conn) or die(mysql_error());
}
Else
{echo $IDNotFound;}
}
?>