php-mySQL insert problem

From: Date: Mon, 01 Aug 2005 22:44:40 +0000
Subject: php-mySQL insert problem
Groups: php.general 
Request: Send a blank email to php-general+get-219800@lists.php.net to get a copy of this message
Hi, I'm new in php so like usual I have little problem(s). I have "DB" clas who connect to database, select database, query database and so on. I have other class "User" with some "members". exemple: ... var $firstName; var $lastName; ... Then I need to insert created object into mySQL database doing something like this: INSERT into TABLE values ($this -> firstName, $this -> lastName); I do that this way: $insertQuery = "Insert into TABLE values (".$this -> firstName.",".$this -> lastName)"); $db = new DB; $db -> query($insertQuery); this is not working and I have next message: Parse error: parse error, unexpected T_OBJECT_OPERATOR in /Library/Apache2/htdocs/Users.php on line 80 I think that my error is in escape characters and I dont not know hox to resolve my problem. Any help is welcome. Thanks in advance ADI

« previous php.general (#219800) next »