DB - How To Add Tables To Database »  Show posts from    to     

Icy Phoenix


Documentation And How To - DB - How To Add Tables To Database



Chaotic [ Sat 22 Aug, 2009 00:15 ]
Post subject: DB - How To Add Tables To Database
[DOC] How To Add Tables To Database

So you've found a new modification that you'd like to use on your Icy Phoenix website? Many modifications you'll find here and on other websites will have special instructions letting you know you'll be adding new or altering some tables to your database. For those type of modifications to work, you'll need to update your database.

Assuming you know how to access your Icy Phoenix database, look to see what your tables are prefixed with. If you installed Icy Phoenix using the default prefix, your database tables will have "ip_" in front of them. Many users are used to prefixing their tables with the "phpbb_" prefix. In fact, it doesn't matter what you use as your prefix when installing a fresh copy of Icy Phoenix. What matters is you are consistent and remember to name all future prefixes the way you started.

When viewing the install instructions inside a modification folder, you may see something similar to this:

Spoiler: [ Show ]


Notice the lines that detail the prefixes such as:

Code: [Hide] [Select]
CREATE TABLE `ip_medal` (


Code: [Hide] [Select]
CREATE TABLE `ip_medal_user` (


Code: [Hide] [Select]
CREATE TABLE `ip_medal_mod` (


Code: [Hide] [Select]
CREATE TABLE `ip_medal_cat` (


Code: [Hide] [Select]
INSERT INTO `ip_config` VALUES ('allow_medal_display', '0');
INSERT INTO `ip_config` VALUES ('medal_display_row', '1');
INSERT INTO `ip_config` VALUES ('medal_display_col', '3');
INSERT INTO `ip_config` VALUES ('medal_display_width', '');
INSERT INTO `ip_config` VALUES ('medal_display_height', '');
INSERT INTO `ip_config` VALUES ('medal_display_order', '');
INSERT INTO `ip_medal_cat` VALUES ('1', 'Default', '10');


Clearly the prefix that is used in this example is "ip_". What if your database prefixes are not "ip_"? You simply change the "ip_" prefix in the install instructions to whatever your prefix is.

If your table prefix is "ilovedogs_", you would need to turn these install instructions into this:

Spoiler: [ Show ]


prefix1
In the picture to the right, my database tables are prefixed with "phpbb_". Since my table prefix is "phpbb_", I must make sure that I change these install instructions to fit my prefix.

Once you have changed the prefixes to suit your needs, we're ready to add them to the database. Using MySQL, click the SQL tab at the top of the page. Copy and paste the whole command or just copy each block separately. I took the following SQL, added it, and you can do the same:





















Code: [Hide] [Select]
CREATE TABLE `phpbb_medal` (
`medal_id` mediumint(8) UNSIGNED NOT NULL auto_increment,
`cat_id` mediumint(8) UNSIGNED NOT NULL default '1',
`medal_name` varchar(40) NOT NULL,
`medal_description` varchar(255) NOT NULL,
`medal_image` varchar(40) NULL,
PRIMARY KEY (`medal_id`)
);


I was then told "Your SQL query has been executed successfully (Query took 0.0137 sec)".








sql

Keep following the special SQL instructions in the install file until you are finished.


spydie [ Sat 22 Aug, 2009 00:28 ]
Post subject: Re: [DOC]How To Add Tables To Database
Very good one , Chaotic.

this is absolutly the easy to follow version off this issue.

If someone after reading this still does have no clue,

when i don“t know.

Brilliant job Gary


Chaotic [ Sat 22 Aug, 2009 19:35 ]
Post subject: Re: [DOC]How To Add Tables To Database
It's a bit lengthy, but I think it needed to be. Details are everything and if this DOC helps just one person, it's done the job.

Thanks spydie!


DWho [ Sat 29 Aug, 2009 11:44 ]
Post subject: Re: DB - How To Add Tables To Database
great guide Chaotic...

will be really useful to some members...





Powered by Icy Phoenix