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? Link to comment https://forums.phpfreaks.com/topic/100479-solved-decimals-in-enums-mysqlphp/ Share on other sites More sharing options...
obsidian Posted April 10, 2008 Share Posted April 10, 2008 ENUM really wouldn't be the best way to go. If you are wanting the value to be treated as a number, you need to have a numeric type on the column. I would recommend simply having a float type with a DEFAULT of 6.25. If you do that, then you just don't have to insert a value into that column at all, and you can run aggregate functions on it (such as SUM). Link to comment https://forums.phpfreaks.com/topic/100479-solved-decimals-in-enums-mysqlphp/#findComment-513824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.