PDA

View Full Version : userid set to 0 in many rows in post table - HELP


Master Computer
07-15-2003, 08:58 PM
There are some threads when I send the reply to; I see these lines when it's supposed to redirect me to the thread page:
Database error in vBulletin 2.2.8:

Invalid SQL: SELECT SUM(views) AS personalviews FROM thread
WHERE postuserid= AND open!='10'
mysql error: You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'AND open!='10'' at line 1
mysql error number: 1064 ....

The strange thing I found is that there were many rows in post table which have userid=0 while other columns for those rows are fine.
I can fix that manually and set the userid to the related one with the same username column in user table.
But that way won't be practical when I have more than 7000 rows suffering from this problem.
Any help for a query/script to fix that?
Thanks in advance for your help.

SmEdD
07-15-2003, 09:07 PM
Did you delete users? 0 = guest or deleted user.

Master Computer
07-15-2003, 09:10 PM
I didn't delete users.
besides, those users having the posts do exist and not deleted.