News:

Wondering if this will always be free?  See why free is better.

Main Menu

mySQL/php help

Started by reznorsoft, July 09, 2004, 09:19:00 PM

Previous topic - Next topic

reznorsoft

okay .. I've browsed through all 25 pages of this category and have an idea of what I need to do, but am clueless on how to actually do it

I have two forums (SMF) installed on my server .. one is SMF 1 Beta 4.1 (converted from YabbSE) the other is a clean Beta 5 Public install.
I'd like to import the database info from my active forum into the freshly installed forum, but before I can do that I have to make some changes with respect to the database prefix.

Here's what I mean .. forum 1 uses prefix _yabbse for the database .. while forum2 uses prefix _community .. so what I'm looking for is a way to convert the database prefix before I can upload it to the new forum.
But I don't know how to do it .. I've come to the understanding (unless I got it all wrong) that I can do this using the UPDATE statement in mySQL but that's where the buck stops. I think it can also be done with a php script but I'm clueless in that department too .. also, I'm not sure if I need to make the changes to each table individually, or if the change can be applied to the entire database at once.

Can anyone help me out?

The Mole

Quote from: reznorsoft on July 09, 2004, 09:19:00 PM
okay .. I've browsed through all 25 pages of this category and have an idea of what I need to do, but am clueless on how to actually do it

I have two forums (SMF) installed on my server .. one is SMF 1 Beta 4.1 (converted from YabbSE) the other is a clean Beta 5 Public install.
I'd like to import the database info from my active forum into the freshly installed forum, but before I can do that I have to make some changes with respect to the database prefix.

Here's what I mean .. forum 1 uses prefix _yabbse for the database .. while forum2 uses prefix _community .. so what I'm looking for is a way to convert the database prefix before I can upload it to the new forum.
But I don't know how to do it .. I've come to the understanding (unless I got it all wrong) that I can do this using the UPDATE statement in mySQL but that's where the buck stops. I think it can also be done with a php script but I'm clueless in that department too .. also, I'm not sure if I need to make the changes to each table individually, or if the change can be applied to the entire database at once.

Can anyone help me out?


Do you have phpMyAdmin access? That would help a ton... if not let me know and i'll write yee a script to run. (I'd like one of the mods to approve it of course)

-the mole

reznorsoft

no I don't have phpMyAdmin .. but that can easily be remedied
I run my own server, and thus have access to mySQL so I thought I could use something like
UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value

but I'm not sure if it's that simple

The Mole

Quote from: reznorsoft on July 13, 2004, 08:19:06 AM
no I don't have phpMyAdmin .. but that can easily be remedied
I run my own server, and thus have access to mySQL so I thought I could use something like
UPDATE table_name
SET column_name = new_value
WHERE column_name = some_value

but I'm not sure if it's that simple

That will just change a column name, but not table names or database names. If you want to change the database name, just change the name of the folder that the db resides in. To change a table name at the mysql prompt use:

RENAME TABLE tbl_name TO new_tbl_name

Does that help? :)

-the mole

reznorsoft

Quote from: The Mole on July 13, 2004, 04:58:01 PM
Does that help? :)
I'll let you know once I try it .. have to wait til Friday .. I'm pulling nightshift this week

reznorsoft

Quote from: reznorsoft on July 14, 2004, 03:57:24 PM
Quote from: The Mole on July 13, 2004, 04:58:01 PM
Does that help? :)
I'll let you know once I try it .. have to wait til Friday .. I'm pulling nightshift this week
RENAME TABLE tbl_name TO new_tbl_name
that did the trick wonderfully .. though, I ended up installing phpmyadmin to make my life easier  :P

thank you

Advertisement: