The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu May 03, 2012 4:25 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Apr 21, 2012 5:22 am
Posts: 12
Hello, i have simple table on my database:

ID --- Message
1
2
3

this is the code used to get info.
Code:
$db =& JFactory::getDBO();
$query = "
  SELECT ".$db->nameQuote('message')."
    FROM ".$db->nameQuote('#__xxxxxxxxx')."
    WHERE ".$db->nameQuote('id')." = ".$db->quote('1').";
  ";
$db->setQuery($query);
$row = $db->loadAssocList();
print_r($row);


and this is its output:

Code:
Array ( [0] => Array ( [message] => This is a test of the xxxxxxxxx software! ) )


to display this:

Code:
echo "</br>just another test! ".$row['0']['message'];


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group