hawkal
05-06-2007, 09:51 PM
Hi in php I am getting it to do something then after it has done that it will check if it is done and working properly. The problem is that because the thing it does in the first place has to be executed so when the script loads it shows the error because what it is checking for has happened yet.
How can I make the part where it checks if everything is ok to wait until after the first action has been executed?
<?php
// This is the first action that is checked in the second action//
$check =mysql_query("UPDATE `something` SET email='' WHERE `someone` = '" . $yea . "'")
or die('MySQL Error: ' . mysql_error());}
//This is the second action that checks if the first action was successful //
if ($check){
echo "<center>some text here</center>";
}else{
//This is the line that gets echo'd before the script has
//been executed properly giving people the
//impression there is a problem with the script.
echo "<center>There is something wrong with the
removal script please contact the admin</center>";
}
?>
I hope you understand.
Thanks
How can I make the part where it checks if everything is ok to wait until after the first action has been executed?
<?php
// This is the first action that is checked in the second action//
$check =mysql_query("UPDATE `something` SET email='' WHERE `someone` = '" . $yea . "'")
or die('MySQL Error: ' . mysql_error());}
//This is the second action that checks if the first action was successful //
if ($check){
echo "<center>some text here</center>";
}else{
//This is the line that gets echo'd before the script has
//been executed properly giving people the
//impression there is a problem with the script.
echo "<center>There is something wrong with the
removal script please contact the admin</center>";
}
?>
I hope you understand.
Thanks