Hi Guys, please help. I have a form where only registered users can access. Now in the first part of the form I have a php action pulling data from the DB until I get to the following:
It will return nothing because it cant find the current userid of the logged in user, however if I change the $userid to the id of a logged in member the results display correctly. How do I dynamically use the above code to retrieve user id and input it after the WHERE call?
Thanks
Please bare in mind Im new to php code.
<?php
$db = JFactory::getDBO();
$db->setQuery('SELECT cf_deladdress FROM #__uu_users WHERE user_id=$userid');
$databaseTitle = $db->loadResult();
?>
<?php echo $databaseTitle; ?>
It will return nothing because it cant find the current userid of the logged in user, however if I change the $userid to the id of a logged in member the results display correctly. How do I dynamically use the above code to retrieve user id and input it after the WHERE call?
Thanks
Please bare in mind Im new to php code.