1
McJagger
Module development: MYSQL insert not working
  • 2005/2/17 10:58

  • McJagger

  • Just popping in

  • Posts: 20

  • Since: 2004/12/11


Hey.

I have kind of a wired problem...

I'm developing a module, and I have this code:

$sqlinsert="INSERT INTO xoops_kina_cinemas 
(cinema_name,cinema_image,cinema_address,cinema_phone,cinema_website)
 VALUES('bla','vla','vka','dsa','dddd')"
;

    if (!
$xoopsDB->query($sqlinsert))
            {
                echo 
"Error in SQL<br />" .$sqlinsert"<br />" $xoopsDB->error();
            }


But the insert doesn't work, i don't get any error message and when I try (by copy'n'paste) the same sql-statement in phpmyadmin, it works perfectly. The code is executed andI get my echo out, but the database stays empty?!?

Have I missed something??!?

2
Mithrandir
Re: Module development: MYSQL insert not working

Search for queryF()

3
McNaz
Re: Module development: MYSQL insert not working
  • 2005/2/17 11:33

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


Xoops does not allow inserts, updates or delete SQL operations if it is initiated by a GET request (such as clicking on a URL link to delete a line for example). These are only allowed during a POST.

Only select SQL statements are allowed with GET.

As Mith suggested, you need to use queryF or change your logic to be triggered by a POST.

HTH.

Cheers.

McNaz.

Login

Who's Online

270 user(s) are online (183 user(s) are browsing Support Forums)


Members: 0


Guests: 270


more...

Donat-O-Meter

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

Latest GitHub Commits