PDA

View Full Version : Mysql error - lastpostby


ITALY!
07-02-2002, 11:56 AM
hi, my forum - http://www.thugnature.net/forums has had an error when u visit the front page....


the messsage i am being given is -

Database error in vBulletin 2.2.5:

Invalid SQL: SELECT iconid,thread.title AS title FROM thread WHERE lastposter='Eli'Jah' AND thread.lastpost=1025437486 AND open!='10' ORDER BY lastpost DESC
mysql error: You have an error in your SQL syntax near 'Jah' AND thread.lastpost=1025437486 AND open!='10' ORDER BY lastpost DESC' at line 1

mysql error number: 1064

Date: Tuesday 02nd of July 2002 12:47:48 PM
Script: http://www.thugnature.net/forums/forums/
Referer:

some1 told me there should be an addslashes there somewere, but i really dont know what to do as they didnt help me...cause they wouldnt tell me how to fix it...

i have edited alot of the files for installing hacks, but have stuck to the instructions!

but plz can some1 help!

thanks

Admin
07-02-2002, 01:46 PM
What hack did you install there?

scsa20
07-02-2002, 05:25 PM
I think I know what's wrong, you have someone with a username of Eli'Jah, in thory, that one part of his name Eli' is causeing the troble (look at the red thing) because (remember, I'm just thinking if it is or not, I'm no PHP god) it's like ending it, I think for you to fix it is by changeing the line from:


SELECT thread.title AS title FROM thread WHERE lastposter='$forum[lastposter]' AND thread.lastpost=$forum[lastpost]


to


SELECT thread.title AS title FROM thread WHERE lastposter=addslashes($forum['lastposter']) AND thread.lastpost=$forum[lastpost]


(part code from firefly (next post) that fixed it :))

in thory, it should work but, I don't know what I'm doing, but if this helps, I'll be surpise :D

good luck ;)

Admin
07-02-2002, 06:05 PM
You want to have addslashes($forum['lastposter'])...

scsa20
07-02-2002, 06:43 PM
thanks firefly, learning something new everyday :)

ITALY!
07-03-2002, 10:24 AM
i tried editing that, but it gave me a parse error.....are u sure i add that?

ITALY!
07-04-2002, 08:26 AM
any other suggestions?