php-mySQL insert problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux