30
hi all. newbie php questions here. i have a basic understanding of how to use
xoopsDB. I'm currently trying to write a script to clean up my database and i'm getting the error,
Quote:
DELETE * FROM xpstestsite_xps_torrents WHERE TIMEDIFF(NOW(), xpstestsite_xps_torrents.last_scrape) >= '0000-00-02 00:00:00'
Error number: 0
Error message: Database update not allowed during processing of a GET request
i have the following on my index.php page,
Quote:
include(XOOPS_ROOT_PATH.'/modules/xpstorrent/clean.php');
and this is what clean.php looks like,
Quote:
<?php
/*
* xpsTorrent! - a bittorrent tracker module for XOOPS
* by eric235u
*
* clean.php
*/
require('../../mainfile.php');
global $xoopsDB;
// if scrape fails for 2 days DELETE
$table = $xoopsDB->prefix('xps_torrents');
$result = $xoopsDB->query("DELETE * FROM $table
WHERE TIMEDIFF(NOW(), $table.last_scrape) >= '0000-00-02 00:00:00'");
?>
so i guess my question is, how the heck do i execute this query? is it not proper to do it as an include or am i just using xoopsDB incorrectly?
thanks for any tips.