Hi,
I have this problem:
My custom code is
and it work right.
But if I add this
it don't work.
Everyone can help me?
Thanks
I have this problem:
My custom code is
$db =& JFactory::getDBO();
$query = "UPDATE `MY_TABLE` SET `MY_FIELD` = 'Si' WHERE `MY_TABLE`.`FIELD` = '$VAR'";
$db->setQuery($query);
$db->query();
and it work right.
But if I add this
if(mysql_affected_rows() => 1)
{
echo 'OK';
}
else
{
echo 'NO!';
}
it don't work.
Everyone can help me?
Thanks
Hi pierpari,
You need to check the Joomla! code and check the value from the $db object. It's probably something like $db->numRows() but I'm far from certain about that.
Bob
You need to check the Joomla! code and check the value from the $db object. It's probably something like $db->numRows() but I'm far from certain about that.
Bob
I find and try this:
$db->affectedRows();
but don't' work. The problem is that if i add everything to the first code it don't update.
Do you understand?
This work
If I add just this, it don't work (don't print "OK" and don't update table
Why?
$db->affectedRows();
but don't' work. The problem is that if i add everything to the first code it don't update.
Do you understand?
This work
$db =& JFactory::getDBO();
$query = "UPDATE `MY_TABLE` SET `MY_FIELD` = 'Si' WHERE `MY_TABLE`.`FIELD` = '$VAR'";
$db->setQuery($query);
$db->query();
If I add just this, it don't work (don't print "OK" and don't update table
echo "OK";
Why?
This topic is locked and no more replies can be posted.