1
fatman
DELETE FROM not working
  • 2003/12/17 3:04

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


I'm new to XOOPS but loving every minute of it. I'm building my first module which does little more than add and edit records from a single table. However, I can't seem to get xoopsDB to delete a record for me. I've been able to search and update records with no issues, but the following code doesn't work. Can someone enlighten me?

$sql "DELETE FROM ".$xoopsDB->prefix('mytable')." WHERE recordid = ".$_GET['id'];

$result $xoopsDB->query($sql);


The SQL statement works if given directly to my MySQL server.

2
fatman
Re: DELETE FROM not working
  • 2003/12/17 4:32

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13



3
AAINC
Re: DELETE FROM not working
  • 2003/12/17 4:39

  • AAINC

  • Not too shy to talk

  • Posts: 121

  • Since: 2003/10/18


Hello,
would love to get copy of what you currently have..

Try something like this.
I have been having problems myself, so this only suggestion.

Quote:

$xoopsDB->queryF("DELETE FROM ".$xoopsDB->prefix('mytable')." WHERE recordid =".$_GET['id'];

$result=$xoopsDB->query("SELECT id FROM ".$xoopsDB->prefix('mytable'));


Mmm, something like that.

AAINC

4
AAINC
Re: DELETE FROM not working
  • 2003/12/17 4:41

  • AAINC

  • Not too shy to talk

  • Posts: 121

  • Since: 2003/10/18


Cool did it work, what you found?

5
fatman
Re: DELETE FROM not working
  • 2003/12/17 6:45

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


yeah.. I just didn't know that I had to be sending my id with POST and not GET. So I just changed my link to a small form and submitted the request by post.

If you have that option you should try it. I didn't give your method above a try. But thanks for the response.

also.. I have to give total props to the core team here. XOOPS lets me forget about having to worry about so many things and I can focus on just the functionality of my pages and my user.

I'm pretty decent with php/mysql so I'm just getting used to the XOOPS core class files.

Login

Who's Online

199 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 199


more...

Donat-O-Meter

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

Latest GitHub Commits