jamesxg1 Posted July 18, 2009 Share Posted July 18, 2009 mysql_query("INSERT INTO `members` VALUES('getfirstname()', 'getlastname()', 'getusername()', 'getpassword()', 'gettelephone()', 'getaddress()', 'getpostcode()')") or die(mysql_error()); in the database it is inserting the names i have wrote and not the value behind them eg. getfirstname() is inputted into the database, what am i doing wrong ?, James. Link to comment https://forums.phpfreaks.com/topic/166441-solved-mysql-insert-problem/ Share on other sites More sharing options...
mmarif4u Posted July 18, 2009 Share Posted July 18, 2009 You are inputing function into single quotes. Try it like this way: $name = getfirstname(); And then write $name instead of function in the insert query. Link to comment https://forums.phpfreaks.com/topic/166441-solved-mysql-insert-problem/#findComment-877691 Share on other sites More sharing options...
jamesxg1 Posted July 18, 2009 Author Share Posted July 18, 2009 Sorry =/ My mind wasn't on track there lol all you have to do is change them to $this->firstname lol cheers mate. Link to comment https://forums.phpfreaks.com/topic/166441-solved-mysql-insert-problem/#findComment-877697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.