Hi there,
I've written the following function which is called by another function, both of which are within the same class.
function dbquery($query)
{
$connection = mysql_connect($this->dbserv,$this->dbuser,$this->dbpass)
or die(mysql_error());
$ret = mysql_db_query($this->$dbname,$query,$connection)
or die(mysql_error());
return $ret;
}
Now when this function is called I get "No database selected error".
Now that function uses the following two functions to operate:
function call_dbfunction()
{
$this->dbfunction("localhost","root","","aupairagency");
}
function dbfunction($dbserv,$dbuser,$dbpass,$dbname)
{
$this->dbserv = $dbserv;
$this->dbuser = $dbuser;
$this->dbpass = $dbpass;
$this->dbname = $dbname;
}
Any ideas?
Thanks in advance,
Chris