You are here: php-mySQL insert problem « PHP « IT news, forums, messages
php-mySQL insert problem

Posted by Adi Zebic on 08/02/05 01:44

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация