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
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.

Edited by dani33l_87
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.