Page 1 of 1

Webhosting: warning on delete SQL commnad

Posted: Tue Mar 04, 2008 1:53 pm
by FredFlinstone
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

Re: Webhosting: warning on delete SQL commnad

Posted: Wed Mar 05, 2008 5:53 pm
by Hackwar
What kind of result would you want to load with a delete query?

Use $database->Query() instead