Webhosting: warning on delete SQL commnad
Posted: Tue Mar 04, 2008 1:53 pm
Hi joomlers,
my web is running on webhosting (siteground.com). In one of many Joomla components is script with DELETE some data from database written in following way:
/* delete data from db-table: */
$database->setQuery("DELETE FROM #__SomeTable WHERE id=".$PassSomeID." AND id_XY=0 AND OtherCode=\"".$PassOtherCode."\"");
$AffectedRows = $database->loadResult();
...
and after performing this command reaches (only on webhosting, not on my localhost) warning:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/myweb/public_html/includes/database.php on line 416
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/myweb/public_html/includes/database.php on line 419
and data is deleted in database.
Mentioned script "database.php" (line 416,419):
function loadResult() {
if (!($cur = $this->query())) {
return null;
}
$ret = null;
if ($row = mysql_fetch_row( $cur )) {
$ret = $row[0];
}
mysql_free_result( $cur );
return $ret;
}
What setting is wrong, if I don't want showing this warning?
FF
my web is running on webhosting (siteground.com). In one of many Joomla components is script with DELETE some data from database written in following way:
/* delete data from db-table: */
$database->setQuery("DELETE FROM #__SomeTable WHERE id=".$PassSomeID." AND id_XY=0 AND OtherCode=\"".$PassOtherCode."\"");
$AffectedRows = $database->loadResult();
...
and after performing this command reaches (only on webhosting, not on my localhost) warning:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/myweb/public_html/includes/database.php on line 416
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/myweb/public_html/includes/database.php on line 419
and data is deleted in database.
Mentioned script "database.php" (line 416,419):
function loadResult() {
if (!($cur = $this->query())) {
return null;
}
$ret = null;
if ($row = mysql_fetch_row( $cur )) {
$ret = $row[0];
}
mysql_free_result( $cur );
return $ret;
}
What setting is wrong, if I don't want showing this warning?
FF