0

I m trying to output introtext of article selected by their alias

<?php 
$db =& JFactory::getDBO(); 
$query = "SELECT introtext FROM jmo_content  WHERE alias=branchfr";
$db->setQuery($query);
$text= $db->loadResult(); 
?>

Is it normal? Does it change in joomla 2.5?

GDP
  • 8,109
  • 6
  • 45
  • 82
JinSnow
  • 1,553
  • 4
  • 27
  • 49

1 Answers1

1

Your SQL statement is missing quotes:

$query = "SELECT introtext FROM jmo_content  WHERE alias = 'branchfr'";
GDP
  • 8,109
  • 6
  • 45
  • 82
  • You are fantastic it is working!!! Thank you so much ! But one more question I would like to search in 2 table does it work that one: `$query = "SELECT introtext FROM jmo_content, jmo_xxx WHERE alias='branchen'";' – JinSnow Jun 28 '12 at 17:39
  • 1
    Thank you very much ! It is not working but my query is somewhere wrong. Have beautiful day! Thanks a lot! – JinSnow Jun 28 '12 at 17:50