UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
Our team is away during the weekend. Some answers may already be available on our documentation

Rest assured that we will get back to your posts as soon as the week starts!
  Support is offline

Application work: trying to create an dynamic SQL function

Jostein Rosenlund · ·
2:20 PM Friday, 27 December 2013
None


public function itemID($itemID){
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select( 'typeID','groupID','typeName','description','mass',
'volume','capacity','scapacity','portionSize','raceID',
'basePrice','published','marketGroupID','chanceOfDuplicating')
->from('#__eve_invTypes ')
->where('typeID = ' . "'". $itemID . "'" );
$db->setQuery($query);
$this->set( 'invTypes', $db->loadRow());


}


but my issue is that the only way i know how to call this function are to


$typeID = "12345";
$sql = $this->getModel( 'sql' );
$sql-> itemID($typeID);

and then
$this->set ('querr', $sql->invTypes);


but the way i currently want to do it, are.


  • Iv created a Model, that creates an array. (one of the values is an typeID)
  • then i print out this array as an form in an theme.


then i want to do $db->loadRow()); on some of the value in that table. (this i have to do everywhere in my application)

So I thought it would be smart to create an function for this. but the issue here is that the value $itemID has to be printed out before the Theme are printed out, but i don't know how.
The replies under this section are restricted to logged in users or users with an active subscription with us