Webhosting: warning on delete SQL commnad

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
User avatar
FredFlinstone
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 13, 2006 3:05 pm
Location: Albershausen, Germany
Contact:

Webhosting: warning on delete SQL commnad

Post by FredFlinstone » 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

User avatar
Hackwar
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Sep 16, 2005 8:41 pm
Location: NRW - Germany
Contact:

Re: Webhosting: warning on delete SQL commnad

Post by Hackwar » Wed Mar 05, 2008 5:53 pm

What kind of result would you want to load with a delete query?

Use $database->Query() instead
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.

Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.


Post Reply