1
karuna
hi why this $xoopsDB->query does not works?
  • 2004/6/7 15:05

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Quote:
<?php

include 'mainfile.php';
$sql = 'UPDATE bnb_groups_users_link SET groupid = 5 WHERE uid=3 AND groupid=2';
if ( $result = $xoopsDB->query($sql) )
{
echo "success";
}
else
echo "failed";

?>


i allways got failed

2
marcan
Re: hi why this $xoopsDB->query does not works?
  • 2004/6/7 15:07

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


HI karuna !

Try this :

if ( $result $xoopsDB->queryF($sql) )

queryF instead of query.

Cheers !

3
tl
Re: hi why this $xoopsDB->query does not works?
  • 2004/6/7 15:08

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


It has to do with XOOPS security check. Do a search on queryF will yield useful information.

4
tl
Re: hi why this $xoopsDB->query does not works?
  • 2004/6/7 15:10

  • tl

  • Friend of XOOPS

  • Posts: 999

  • Since: 2002/6/23


marcan: you beat me to it. I was not fast enough.

5
karuna
Re: hi why this $xoopsDB->query does not works?
  • 2004/6/7 15:21

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Quote:

marcan wrote:
HI karuna !

Try this :

if ( $result $xoopsDB->queryF($sql) )

queryF instead of query.

Cheers !


Thanks. it's ok now~~

it cost me 2 hours --;;

6
Mithrandir
Re: hi why this $xoopsDB->query does not works?

Do use queryF with CAUTION. queryF will execute your SQL no matter what request method is used - GET or POST - so if your variables are coming from $_GET you should be ABSOLUTELY certain that it has not been tampered with and that it is indeed an integer (which you can do with intval($variable) to avoid SQL injection.

Login

Who's Online

163 user(s) are online (81 user(s) are browsing Support Forums)


Members: 0


Guests: 163


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