Hi iam trying to get a query from sql in the form submit page, but the query is not connected to the fom table but from other table.
i was adding custom code in the submit section with this code which is not working !!
so please can i know where is the mistake?
thanks so much in advance
				
				
				
			i was adding custom code in the submit section with this code which is not working !!
<?php
$db =& JFactory::getDBO();
$query = "
  SELECT *
    FROM `#__users`
    WHERE id = 42
";
$db->setQuery($query);
echo $query;
?>so please can i know where is the mistake?
thanks so much in advance
					I am not sure if this is a mistake but you are doing
echo $query
which is just the string with the query.
If you want the result of the query you should put something like
Pericles
				
				
				
			echo $query
which is just the string with the query.
If you want the result of the query you should put something like
$data = $db->loadObjectList();
echo $data;Pericles
This topic is locked and no more replies can be posted.
		
	
 
  