update sql not working??

samoht 23 Jun, 2009
Hey guys,

I have the joomla reg plugin for my one form working well... now it concatenates the first_name and last_name together for the name filed as it should. However, I have a profile page form that displays the users data and from that form I allow the users to update their info. For some reason my UPDATE is not changing the jos_users table??


$name = JRequest::getVar('first_name', '', 'post')." ".JRequest::getVar('last_name', '', 'post');

/* now save the name to the jos_users table */
//$db =& JFactory::getDBO();
$q = '
	UPDATE `#__users`
		SET `name` = "'.$name.'"
		WHERE `user_id` = '.$smuser.'';
$db->setQuery($q);
$db->query();
echo print_r($q, true);


see anything I am doing wrong here?
Max_admin 23 Jun, 2009
try to make the query like this:

$q = "UPDATE `#__users` SET `name` = '".$name."' WHERE `user_id` = '".$smuser."'";


Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.