tags:

views:

46

answers:

1

I want to connect the Joomla DB and i have created table in PHPmyAdmin. And want to get the row and values from the field.

A: 

Best way when having a proper JTable:

$row =& JTable::getInstance('my_table', '');
$row->load($id); 

When working without JTable:

$db = &JFactory::getDbo();  
$sql = 'SELECT * FROM #__table WHERE id ='.$id;
$db->setQuery($sql);
$object = $db->loadObject(); 

OFC you can make that more elegant inside MVC. BUT for starters maybe enough.

Mike