1
kerkyra
error
  • 2008/2/19 23:39

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hi i'm trying to make a function to delete one record from the db! the code is the following

Quote:

function delPckg()
{
global $xoopsDB, $HTTP_GET_VARS, $eh;

$pckid = intval($HTTP_GET_VARS["pckid"]);

$xoopsDB->query("DELETE FROM ".$xoopsDB->prefix("addresses_packages")." where pckid=$pckid") or $eh->show("0013");

redirect_header("packages.php",1,_MD_DBUPDATED);

xoops_cp_footer();
}


i have made more functions like this that work fine! This one just keeps giving me the 0013 error! anybody has any ideas why?
whttp://www.guidemap.gr - Beta is out...

2
kerkyra
Re: error
  • 2008/2/20 14:48

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


bump?
whttp://www.guidemap.gr - Beta is out...

3
kerkyra
Re: error
  • 2008/2/21 12:29

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


after a lil digging around, i found on a tutorial that for deleting something from the db its better to use

Quote:
$xoopsDB->queryF("DELETE FROM ".$xoopsDB->prefix("db_name")."


instead of

Quote:
$xoopsDB->query("DELETE FROM ".$xoopsDB->prefix("db_name")."


so i did that to my code and worked fine! Dont know why it didnt work in the first place, all of my other functions work fine like that! Anyway i post this here in case someone else faces the same problem...
whttp://www.guidemap.gr - Beta is out...

Login

Who's Online

439 user(s) are online (347 user(s) are browsing Support Forums)


Members: 0


Guests: 439


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits