|
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
[Back to original message]
|