Jump to content

Is it possible to put a multiplication problem in the mysql "default value".....


brucegregory

Recommended Posts

Is it possible to put a multiplication problem in the mysql "default value" field?

In my script I need to take the unit amount * quantity, I know how to do this in php, but can I just put my equation in the "default value" field in MYSQL and make it equal to another field?... Like excell?

 

Thanks

From MySQL website(http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html):

The DEFAULT value clause in a data type specification indicates a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression.

It appears that you can't do this.

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.