amittripathi2k2
Member
Hi,
I need to be able to get id value
-------------------------- CODE -------------------------------
<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id');
$query->from($db->quoteName('table'));
$query->where($db->quoteName('Company')." = ".$db->quote($b));
$db->setQuery($query);
$result = $db->loadResult();
echo $result;
?>
-------------------------------------------------------------
The actual result is 2, but this code is not returning value.
e.g. Company name is "BNMU", but when I echo $db->quote($b) it renders "BNMU\n" and query doesnt return any value. If I replace it with $db->quote('BNMU'), the result is 2.
If anyone can help this, it would be really helpful.
Thanks
Best Regards
Amit
I need to be able to get id value
-------------------------- CODE -------------------------------
<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id');
$query->from($db->quoteName('table'));
$query->where($db->quoteName('Company')." = ".$db->quote($b));
$db->setQuery($query);
$result = $db->loadResult();
echo $result;
?>
-------------------------------------------------------------
The actual result is 2, but this code is not returning value.
e.g. Company name is "BNMU", but when I echo $db->quote($b) it renders "BNMU\n" and query doesnt return any value. If I replace it with $db->quote('BNMU'), the result is 2.
If anyone can help this, it would be really helpful.
Thanks
Best Regards
Amit