hi
i'm trying to get musql to insert the default values
into a table. from the insert section in the manual:
Warnings can occur under any of the following
conditions:

    * Inserting NULL into a column that has been
declared NOT NULL. The column is set to the default
value appropriate for the column type. This is 0 for
numeric types, the empty string ('') for string types,
and the ``zero'' value for date and time types.

for myisam tables, nulls are handled as above, so how
does one get the default value set to a column? i know
that if a column name is missing in a insert statement
then it get assigned to default value. is there any
way to SET it to the dafault value in an UPDATE query?
so one could use a function like:

switch ($type) {
   case "text":
      $var = ($var != "") ? "'" . $var . "'" : "NULL";
      break; (etc.)

and replace the null with "DEFAULT" so that when mysql
sees the keyword, it sets that column's value to the
column's default (and not the column type's default)

ty
abs

________________________________________________________________________
Download Yahoo! Messenger now for a chance to win Live At Knebworth DVDs
http://www.yahoo.co.uk/robbiewilliams

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to