FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » FUDforum 3.0+ » fud_delete_user() produces SQL error?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
fud_delete_user() produces SQL error? [message #35478] Mon, 15 January 2007 20:29 Go to next message
maarten is currently offline  maarten   United States
Messages: 7
Registered: January 2007
Karma: 0
Junior Member
Does fud_delete_user() in fudapi.inc.php work for other people?

When I call it, I get the following SQL error:
FUDforum2misc/include/theme/default/db.inc:72
FUDforum2misc/include/users_adm.inc:25
FUDforum2misc/scripts/fudapi.inc.php:949
FUDforum2misc/FUDtester.php:73
) 1054: Unknown column 'Object' in 'where clause'
Query: DELETE FROM fud26_mod WHERE user_id IN(Object)

I've tried passing both array(5) and just 5 into fud_delete_user(), makes no difference, problem seems internal.

Looks like fud_delete_user() uses _fud_simple_fetch_query(), which uses db_rowobj() which is returning an object instead of an array as expected by the rest of the code?

Zanks,

/Maarten.

Re: fud_delete_user() produces SQL error? [message #35482 is a reply to message #35478] Tue, 16 January 2007 00:15 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Fixed in CVS.

FUDforum Core Developer
Re: fud_delete_user() produces SQL error? [message #35512 is a reply to message #35482] Wed, 17 January 2007 19:29 Go to previous messageGo to next message
maarten is currently offline  maarten   United States
Messages: 7
Registered: January 2007
Karma: 0
Junior Member
Correct me if you made changes other than this:
http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=11723

The above fix doesn't quite do it. _fud_simple_fetch_query returns type Object, which the else wraps in an array, and then your fix takes the array back off and passes in the object, which usr_delete still chokes on.

It does work if you change your current code to:
	foreach ($data as $v) {
		usr_delete($v->id);		
	}


But you may not want to get an Object back in the first place?
Re: fud_delete_user() produces SQL error? [message #35519 is a reply to message #35512] Thu, 18 January 2007 00:04 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
That's correct, the proper fix has now been applied.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: FUDforum and valid HTML
Next Topic: getting the GLOBALS needed for fudapi
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 18 01:58:08 GMT 2024

Total time taken to generate the page: 0.03020 seconds