You are here: mysql, classes, exceptions and error handling « PHP Programming Language « IT news, forums, messages
mysql, classes, exceptions and error handling

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация