12-17-2009, 10:57 AM
Also to avoid exceptions to be trow en you need to use
try catch finally commands while executing query on the mysql database
example
if you want to make update query and user forgot to enter value for the set something='.var.'
then exception will be trown so you should use this command structure
here is more info about php exceptions and how to use them for anything not just for mysql
http://php.net/manual/en/language.exceptions.php
try catch finally commands while executing query on the mysql database
example
if you want to make update query and user forgot to enter value for the set something='.var.'
then exception will be trown so you should use this command structure
Code:
<?php
try {
$s = mysql_query('Update ...... set..... Select or anything');
}
catch (MyException $e){
echo $e;
}
finaly {
echo 'query executed succesfully';
}
?>
here is more info about php exceptions and how to use them for anything not just for mysql
http://php.net/manual/en/language.exceptions.php