My code is listed below.
Everything works fine, but I'd like to be able to return something just in case the Update SQL didn't work. Is this already taken care of with the die(mysql_error() below?
Thanks!
<?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!";
$strZNumber = $_POST['Znumber'];
#first see if both the ZNumber and password are useable
If ($totalRows_Recordset2==1 && $_POST['Password']==$Password)
{
#Do the update of videoseen
#1st make the connection
$conn = mysql_connect ('localhost','usr','pwd');
#now select the db
mysql_select_db ("videocheck");
$sqlUpdate = sprintf("Update table1 set videoseen=1 Where ZNumber
= ".$_POST['Znumber']);
$rsUpdate = mysql_query($sqlUpdate, $conn) or die(mysql_error());
echo "You now have credit for the video";
}
Else
#Let 'em know the two entries won't allow update!
{echo $IDNotFound;}
}
?>
Everything works fine, but I'd like to be able to return something just in case the Update SQL didn't work. Is this already taken care of with the die(mysql_error() below?
Thanks!
<?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!";
$strZNumber = $_POST['Znumber'];
#first see if both the ZNumber and password are useable
If ($totalRows_Recordset2==1 && $_POST['Password']==$Password)
{
#Do the update of videoseen
#1st make the connection
$conn = mysql_connect ('localhost','usr','pwd');
#now select the db
mysql_select_db ("videocheck");
$sqlUpdate = sprintf("Update table1 set videoseen=1 Where ZNumber
= ".$_POST['Znumber']);
$rsUpdate = mysql_query($sqlUpdate, $conn) or die(mysql_error());
echo "You now have credit for the video";
}
Else
#Let 'em know the two entries won't allow update!
{echo $IDNotFound;}
}
?>