PDA

View Full Version : user profile error


michealo
08-14-2002, 01:17 PM
can someone help me with this error i get when clicking on the profile button of one of my members?

Database error in vBulletin 2.2.1:

Invalid SQL: SELECT COUNT(title) AS starts FROM thread WHERE postusername='Jar O' Pickles' AND open!='10'
mysql error: You have an error in your SQL syntax near 'Pickles' AND open!='10'' at line 1

mysql error number: 1064

Date: Wednesday 14th of August 2002 07:27:32 AM
Script: http://www.psx2central.com/forums/forums/member.php?s=&action=getinfo&userid=3112
Referer: http://www.psx2central.com/forums/showthread.php?s=&threadid=23862&pagenumber=2



would deleting the member, and re-adding him, fix this?

thank you

Lesane
08-14-2002, 01:43 PM
Originally posted by michealo
can someone help me with this error i get when clicking on the profile button of one of my members?




would deleting the member, and re-adding him, fix this?

thank you

Find in member.php this line:

$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postusername='$userinfo[username]' AND open!='10'");

And change it to:

$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postusername='".addslashes($userinfo[username])."' AND open!='10'");

michealo
08-14-2002, 10:32 PM
thank you lesane but im afraid i get the same error for just that one member (well, only that ever mentioned it)

wierd

GSHelpBoy
08-14-2002, 11:42 PM
The reason you received that error was because the ' character was already being used to get the username, and when it found the O', it stopped reading that field, and attempted to move on to the next.

michealo
08-15-2002, 12:51 AM
makes sense

i removed the ' in his name and it seemed to work

thanks

Lesane
08-15-2002, 07:45 AM
It was a bug in the hack "Threads Started By User".

Members with a ' in it will return to that error. I gave you the fix wich should work with all the members that contain ' in their names.

Weird :)

GSHelpBoy
08-15-2002, 05:40 PM
Members with \ and " would also return an error, unless you use addslashes()