im new to joomla and im trying to build a component which is an addon for viruemart to allow users to access invoice PDF's in their user area. To do this i need to write a select query which retreives this information from the database for me.
I have been messing around with it and came up with the following, but it doesnt seem to do anything:
$id =JFactory::getUser()->id;
$db =& JFactory::getDBO();
$sql = "SELECT * FROM jos_vm_orders";
$db->setQuery($sql);
$options = $db->loadObjectList();
return $options;
Am i missing something?