|
Posted by Ramza Brown on 09/20/05 02:21
This mysql_error doesnt give me an error below, but when I run it at the
global scope it does give me errors. I went ahead and checked for
mysql_error(), but normally I dont have to, why?
public function runQuery() {
try {
/// Use mysql_error() to check for errors
if (!empty($this->build_query)) {
$this->sql_result = mysql_query($this->build_query);
$this->lastinsertid = mysql_insert_id();
$err = trim(mysql_error());
if (!empty($err)) {
throw new Exception("".$err);
} // end of if - check error
} // end of if //
} catch(Exception $e) {
$this->error_message = "ERR: ".$e->getMessage();
if ($this->verbose == 1)
echo $this->error_message;
} /// end of try - catch //
return $this->error_message;
} // end of the method //
--
Ramza from Atlanta
http://www.newspiritcompany.com
Navigation:
[Reply to this message]
|