Thanks. <br />Tryed that but did not work. <br />Is it the same if username and displayed name are not the same? <br /> <br />also... is there a way to show the real number of posts for a user... this user had a problem and the number of posts changed... would really like to show the reasl number of posts
U_Username is DisplayName <br /> <br />U_LoginName is the loginname <br /> <br />Those queries above will do exactly what you asked for. You say they dont what is the error you get. You can also suppliment the WHERE U_Username = 'USERNAMEHERE' to WHERE U_Number = 'usernumberhere' Make sure you are not forgetting the slashes around the name or number in the where clause. <br /> <br />As far as getting a post count <br /> <br />SELECT COUNT(*) <br />FROM w3t_Posts <br />WHERE B_PosterId ='USERNUMBERHERE' <br /> <br />Then to update the users total <br /> <br />UPDATE w3t_Users <br />SET U_TotalPosts = 'TOTALHERE' <br />WHERE U_Number = 'USERNUMBERHERE'
#258530 - 01/07/0405:20 PMRe: Useful MySQL Queries for UBB.Threads
[Re: sf49rminer]
Pasqualist
Member
Registered: 01/30/03
Posts: 285
Loc: Amsterdam, The Netherlands
Which query would I need to change the url in U_Picture (Users) ?<br /><br />Example "http://www.domain1.com/forum/userpics/2.jpg"<br /><br />should be changed in<br /><br />Example "http://www.name2.com/forum/userpics/2.jpg"<br /><br />Thanks!
#258532 - 01/07/0406:38 PMRe: Useful MySQL Queries for UBB.Threads
[Re: sf49rminer]
JoshPet
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
No the URL to the avatar is stored in U_Picture - the value in the config file is just for uploads and used when it's being stored.<br /><br />This should do it:<br /><br />UPDATE w3t_Users<br />SET U_Picture = 'http://whatever/what/userpic/2.jpg'<br />WHERE U_Number = xxx<br /><br />Put the usernumber of xxx<br /><br /><img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
#258533 - 01/08/0402:20 AMRe: Useful MySQL Queries for UBB.Threads
[Re: Daine]
Pasqualist
Member
Registered: 01/30/03
Posts: 285
Loc: Amsterdam, The Netherlands
Thanks Josh, but your query would not do the trick for me.. <img src="http://www.ubbdev.com/forum/images/graemlins/laugh.gif" alt="" /><br /><br />I want to change the picture URL for all users, so I only need to change "domain1.com" to "name2.com".
#258534 - 01/08/0408:29 AMRe: Useful MySQL Queries for UBB.Threads
[Re: 10k]
scroungr
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
you need a query that first grabs the link from the database in a query and then pulls the substring of the first domain and inserts the substring of the second domain and then inserts that into the database... but thats a little dangerous if not used correctly..
Edited by scroungr (01/08/0408:36 AM)
_________________________
Couchtomatoe - www.couch-tomatoe.cc My abilities are for hire for installs, upgrades, custom themes and custom modifications.
This will do what you want Pasqualist and is courtesy of Master Scream when I asked him about this issue a while back. <br /> <br />Now this query is mostly for those wanting to update their forums from UBB to Threads and change links in the post bodies as this is where this issue is likely to occur. <br /> <br />UPDATE w3t_Posts SET B_Body = REPLACE(B_Body, 'cgi-bin/ubb','ubbthreads') <br /> <br />Now you can change this query to suit your needs by doing the following to it. <br /> <br />UPDATE w3t_Users SET U_Picture = REPLACE(U_Picture, 'www.domain1.com','www.name2.com') <br /> <br />Now remember to backup your database before doing this but I have ran the first query on my install and it worked fine. It should automatically update the part of the string you want.
#258536 - 01/08/0408:35 AMRe: Useful MySQL Queries for UBB.Threads
[Re: sf49rminer]
scroungr
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
even better <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Couchtomatoe - www.couch-tomatoe.cc My abilities are for hire for installs, upgrades, custom themes and custom modifications.
#258538 - 01/08/0409:10 AMRe: Useful MySQL Queries for UBB.Threads
[Re: sf49rminer]
scroungr
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
forgot all about the mysql REPLACE command <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Couchtomatoe - www.couch-tomatoe.cc My abilities are for hire for installs, upgrades, custom themes and custom modifications.
Ok....I have a request since I'm in the "throws" of re-installing. <br /><br />Would it be possible to repost something as an ADMIN (with the boards closed) and then change the ADMIN association to the original poster? This is so I can re-post threads lost with my ... huhummm... re-installation?<br /><br />Thanks,<br />Patrice
#258540 - 01/08/0401:27 PMRe: Useful MySQL Queries for UBB.Threads
[Re: GrandAmEmt]
scroungr
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
think it's easier to log in as the user... you can switch to them in the admin panel... problem is boards would have to be open not closed..
_________________________
Couchtomatoe - www.couch-tomatoe.cc My abilities are for hire for installs, upgrades, custom themes and custom modifications.
If your missing threads from your threads database after the install of your UBB classic database conversion that malfunctioned after an import and the board went down after running threads for a few days then you can use PhpMyAdmin to input users and posts after the original conversion.<br /><br />I take it now you have a correct conversion running. Just use PHPMYADMIN to import any new users into Threads that are missing from your last Threads backup when it was working before it crashed.<br /><br />You then can do the same thing with the posts table.<br /><br />INSERT INTO `w3t_Users` VALUES ( blah blah blah);<br /><br />INSERT INTO `w3t_Posts` VALUES ( blah blah blah);<br /><br />Your backups when you compare should guide you further where the cutoff is. Problem is if you opened your board back up now after the second import then you cant do this as post numbers and user numbers will have been used that you are trying to import.
#258542 - 01/08/0404:38 PMRe: Useful MySQL Queries for UBB.Threads
[Re: sf49rminer]
scroungr
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
yeah but Omego the way it sounds..<br /><br />[]<br />Would it be possible to repost something as an ADMIN (with the boards closed) and then change the ADMIN association to the original poster? This is so I can re-post threads lost with my ... huhummm... re-installation?<br />[/]<br /><br />is that she wants to post those lost as herself then go in later and change the name of who posted it to the original person cause she lost them...
If she lost the posts and does not have a backup to do what I am saying then how is she going to know what to post to do what your saying <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />See my point.
Glutton for punishment. My solution. Probably not the best, but it got the job done. I ended up make all the forums "read-only" with admin and MODERATOR read/write. Made the user a temporary moderator, logged in as them and reposted their thread and demoted them. I'm cross-eyed, but it's done. Whew. Think I'll BACK IT UP now! <img src="http://www.ubbdev.com/forum/images/graemlins/grin.gif" alt="" /> <br /> <br />-Patrice