anser316 Posted April 10, 2008 Share Posted April 10, 2008 Hi in a table i want just one number (6.25) that i want added to all rows. e.g. ID cust_num 1 6.25 2 6.25 3 6.25 I would like it as the default value if it is not inserted also. I was thinking ENUM('6.25') NOT NULL I have some issues though with this Can I do sums with ENUM on php or mysql? e.g. $row2[total_quantity]*$row[cust_num] And if so do i need quotes as it will be like a float or decimal? Quote Link to comment Share on other sites More sharing options...
fenway Posted April 10, 2008 Share Posted April 10, 2008 ENUM? What are you thinking? What do you mean "added to all rows"? Quote Link to comment Share on other sites More sharing options...
aschk Posted April 11, 2008 Share Posted April 11, 2008 If you're dealing with money where the calculations need to be penny perfect, then use NUMERIC. And if you want to specify a DEFAULT field value, then give your table a default column value. "ENUM", i mean ??? were you thinking... ALTER TABLE <table name here> MODIFY COLUMN cast_num NUMERIC(6,2) NOT NULL DEFAULT 6.25 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.