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

Posted by bugzstuff on 09/20/05 04:23

>From your post, I presume you must be using classes... It seems from my
limited knowledge that the problem is related to the scope of your
mysql_* function rather that a problem with it. If you are not
declaring the connection object in your function, it will not be
available to give an error...
Remember that you must reference your connection object throughout your
class..
For a similar class, I've done this:



//(connecting to mysql)
$this->dbConnection = mysql_connect($this->host, $this->user,
$this->password);

//Later on the "runQuery" function:
$this->sql_result = mysql_query($this->$sql,$this->dbConnection) ;



//Finally the error handling uses:
mysql_error($this->dbConnection);



Hope this helps...


--
Bugz
http://bugz.doutromundo.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

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