Jump to content

Assign a new field to a module in MySql


dani33l_87

Recommended Posts

Hi,

 

Inside the databse I have the module mn_news.

How I supose to add in a nicely way a new field for the entire module mn_news with a new column isBlog TYPE small(1) and DEFAULT '0' NOT NULL".

 

Also I want to change the value of the collumn OwnerType type enum , value to be "player" in mn_news

 

Other thing that maybe is more complicated is that inside of the mn_news I have the column Credit with different kind of value and I want to have the same values inside the other module mn_money ,column Money.

 

I found somenting one google but they are very different answers and I don t want to mess with the databse.

Somebody can help me?

 

 

Rgds.

Link to comment
https://forums.phpfreaks.com/topic/273731-assign-a-new-field-to-a-module-in-mysql/
Share on other sites

ok, I will try again... I have a database named operation

 

Inside the databse I have two tables (modules) mn_news and mn_money

 

For each data inside mn_news need to add a new field/column (there are also ID, NAME, etc ) isBlog that contain the TYPE small(1) with the VALUE 0

 

also to add a other field/collumn OwnerType type enum , value to be player

 

 

The second part I also don t understand because I supose to put the same value according with some ID or something.

For the moment I will try to fix the first part.

I don't think this is dynamically changing, but rather correcting the design of the table. Just a guess though, as there's precious little information on why the OP wants to do this.

 

Dani: You really need to read up more about MySQL and its SQL dialect. What you're looking to do is very easily done with a simple ALTER TABLE statement.

However, it's also very easy to do something wrong with it, so I strongly recommend teaching yourself first using some test-data. Then, once you're comfortable enough, take a backup of the live data and test on it. Once you've confirmed the process to be working, implement it on the actual data.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.