News:

Support the VirtueMart project and become a member

Main Menu

Variable from database

Started by Namit, April 11, 2012, 12:18:15 PM

Previous topic - Next topic

Namit

hello,
What should I do to show variable from database in virtuemart.  I use Virtuemart 2.0.2 and Joomla 2.5.4.  I create "_mary" table. I filled two columns by "30" for pole_mary2 and "1" for "pole_mary1".  I would like to get variable that contains "30".
I wrote this code:

<?php
$db 
=& JFactory::getDBO();
$query "
 SELECT "
.$db->nameQuote('pole_mary2')."
 FROM "
.$db->nameQuote('#_mary')."  
 WHERE "
.$db->nameQuote('pole_mary1')." = ".$db->quote('1').";
"
;
$db->setQuery($query);
$result $db->loadObject();
?>

<?php   echo  $result->$pole_mary2  ?>


What I do wrong? Cart work correctly but variable doesn't want to appear.