Skip to Content Skip to Menu

Mysql Select statement to access the CB tables

  • carlj315
  • carlj315
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
13 years 3 months ago #168767 by carlj315
Need code to access new fields the CB tables

Here are a couple that did not work

$query = 'SELECT *'
. ' FROM jos_comprofiler'
. ' WHERE id = ' . $my->id;
$db->setQuery( $query );
$cbusr = $db->loadObject();

echo 'account type: '.$cbusr->cb_accountype.'<br>';

And the other one is below:

$database =& JFactory::getDBO();
$database->setQuery("SELECT 'id' FROM jos_comprofiler WHERE 'id='".$$my->id."'");
$database->query();

echo 'account type: '.$database->cb_accountype().'<br>';

Getting the followiing error:

Fatal error: Call to a member function setQuery() on a non-object in /home/jwebt105/public_html/components/com_jumi/views/application/view.html.php(38) : eval()'d code on line 35

Got this code from searching google and forums.

Just need the code....select for now

Thanks

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum