PDA

View Full Version : Need help writing a MySQL query


TeddyKGB
12-15-2007, 02:31 AM
SO I am working with another board to merge our two boards together and after I used Impex it appears a handful of users get imported but their userid is set to 0. This means when you look at a post made by that user the username is not clickable. I want to update those specific users to another pre-existing username and userid but I don't know how to write update queries.

Here is the query I get from MySQL when I do a search on the "post" table.

SELECT *
FROM `post`
WHERE `username` LIKE CONVERT( _utf8 'J'
USING latin1 )
COLLATE latin1_swedish_ci
AND `userid` =0
LIMIT 0 , 30

How do I alter that to update the username to 'TeddyKGB' and userid to 460?

Marco van Herwaarden
12-15-2007, 06:43 AM
Did you also run all the Update Counters from AdminCP -> Maintenance, as instructed after an import?

TeddyKGB
12-15-2007, 11:53 AM
Yup sure did. Although I am going to clear it all out and start again because there seems to be another small bug. THis particular problem occured on our first test run so I fell it will probably occur again.

--------------- Added 1197751972 at 1197751972 ---------------

Is anyone able to assist with creating an update query out of the query I provided above? I am just not that famaliar with the syntax of the SQL used here in MYSQL.

THanks

Marco van Herwaarden
12-16-2007, 06:16 AM
If your posts end up as guests, then i suggest you create a support ticket on resolving this issue.