Way to change author via phpmyadmin SQL query?

Status
Not open for further replies.

mistafro

Customer
I was just wondering if there would be a way to change the author of files added via an SQL query for now on the author field and perhaps add comments and comment authors via this method as well.

could you tell me the ids/fields for these if so?
 
Can we somehow?
To change the author of all files to one author run the following:

Code:
UPDATE [COLOR="red"]{YOUR TABLE PREFIX}[/COLOR]dbtech_downloads_filegroup
SET userid = [COLOR="red"]1[/COLOR]

Change {YOUR TABLE PREFIX} with your table prefix and 1 with the userid of the new author.
 
Anyway to change the author field
On each post via SQL? I want to put the original author for each file upload to recreate it as it was in downloads II.
 
Anyway to change the author field
On each post via SQL? I want to put the original author for each file upload to recreate it as it was in downloads II.
You would add
Code:
WHERE groupid = 1
to the end of the above query, changing the 1 with the downloadid.
 
Awesome thanks! lastly, I am going through and adding all the comments to files that were in my Downloads II install and I tried this SQL query to edit the author of comment 3 but it changed them all to the author whose userid was 1522. How could I adjust this query to edit the third comment for example?

UPDATE `dbtech_downloads_comments` SET userid = 1522 WHERE comid = 3
 
I think I got it, will post here so others can make use of this:

UPDATE `dbtech_downloads_comments` SET userid = 1522 WHERE fileid = 30 AND comid = 3

So basically, search the username in your vbulletin admin and you will see it's userid #, then on the files download page you will see the fileid in the url and lastely the comid is the number of the comment in order it was posted. Hard for me to explain but makes sense in my head! LOL
 
Now that that's working, what's the deal with the dates? I see a dateline field in SQL that shows a number like this:

1290735970

How do I edit the date the comment was posted?
 
Now that that's working, what's the deal with the dates? I see a dateline field in SQL that shows a number like this:

1290735970

How do I edit the date the comment was posted?
That is a UNIX timestamp. It is basically the number of seconds since Jan 1st, 1970. If you need to convert dates over, take a look at this site which will generate the timestamp for you from a set date.

http://www.4webhelp.net/us/timestamp.php
 
Status
Not open for further replies.

Similar threads

Top