Does this line have a space between echo and "" ?? echo and quotes are together.
Maybe that's the problem
At 10:40 PM 5/21/2003 +0200, you wrote:
HI,
Not really a db problem, but has something to do with a dbase
I'm tryin to make a database class, but every time i make a class, and execute the file i get:
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /home/new.php on line 4
I have one working class but another just wont work...
The not working one (simplyfied) <?php class Dbase { function connection() { echo"connect"; } } ?>
--------
<?php include ("dbase.php");
$test = new Dbase; $test->connection();
?>
The code i made which works: class Database { function Database($host, $database, $username, $password) { $this->host = $host; $this->database = $database; $this->username = $username; $this->password = $password; }
function connect() {
$this->db = mysql_connect($this->host, $this->username, $this->password);
if ($this->db == false) {
return FALSE;
} else {
return TRUE;
}
}
}
// Make the object
$db = new Database("localhost", "dbase", "user", "pass");
$db->connect();
what am i doing wrong? Cuz i really dont understand this.. really freaking me out
Tnx in Advance
Fedde
Jadiel Flores ------------------------- http://www.abargon.com jflores@abargon.com (52-55) 52-29-80-34
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php