Can i execute some code in the or die of a query? I want to do this if the update of the db fail: setcookie ("Login", "", time() - 60*60);
Here is the update.
mysql_query($UpdateCookie,$db) or die("Error:".mysql_error());I jsut learned we can put everything we want after the or, but can we put a or on every instructions?
will it work on a setcookie?no, if the cookie doesn't get set then it just doesn't work, it will not show you an error message if it doesn't get set. mysql_query (or any other function) will show you erros, you can surpress these errors by using the @ and the DIE() function. so in reality this
mysql_query($UpdateCookie,$db) or die("Error:".mysql_error());
should be this
@mysql_query($UpdateCookie,$db) or die("Error:".mysql_error());and what the @ is doing exactly?it will surpress the regular error message so you can jus tsee the message in teh die function
Here is the update.
mysql_query($UpdateCookie,$db) or die("Error:".mysql_error());I jsut learned we can put everything we want after the or, but can we put a or on every instructions?
will it work on a setcookie?no, if the cookie doesn't get set then it just doesn't work, it will not show you an error message if it doesn't get set. mysql_query (or any other function) will show you erros, you can surpress these errors by using the @ and the DIE() function. so in reality this
mysql_query($UpdateCookie,$db) or die("Error:".mysql_error());
should be this
@mysql_query($UpdateCookie,$db) or die("Error:".mysql_error());and what the @ is doing exactly?it will surpress the regular error message so you can jus tsee the message in teh die function