I have this code. PHP parser gives me an error in the method declaration line (function mysql_queries( ). It says
parse error, expecting `')'' in /web/www/test/classes.php on line 14
When i declare this method as a simple function it works with no ploblems.
Why this?
<?php
class mysql_vars{
var $host='localhost';
var $user='root';
var $pass='';
var $db='test';
}
class mysql_queries extends mysql_vars{
var $query;
var $show_query='off';
function mysql_queries($this->host,$this->user,$this->pass,$this->db){
$thread=@mysql_pconnect($this->host,$this->user,$this->pass);
if (!$thread){
echo "Sorry. MySQL says: " . mysql_error();
return;
}
$step2=@mysql_select_db($this->db);
if (!$step2){
echo "Sorry. MySQL says: " . mysql_error();
return;
}
} // mysql_queries
function q($this->query,$this->show_query){
if ($this->show_query=='on'){echo $this->query}
return @mysql_query($this->query);
}
}
?>