Hi
as everyone knows chronoform saves the Id of form's submitter
but I wanna use their names instead of Id so I tried this
but it didn't work so I tried to use query
and the error is this :
what can I do ?
as everyone knows chronoform saves the Id of form's submitter
but I wanna use their names instead of Id so I tried this
<?php
$id="{cf_user_id}";
$user =& JFactory::getUser($id);
echo $user->name;
?>
but it didn't work so I tried to use query
$id='{cf_user_id}';
$db =& JFactory::getDBO();
$query = "SELECT name, username FROM `jos_users` WHERE `id` = ".$id;
$db->setQuery($query);
$result = $db->loadObject();
echo $db->getErrorMsg();
echo $result->name;
and the error is this :
You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near '}' at line 1
SQL=SELECT name, username FROM `jos_users` where id = 62
what can I do ?