PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I set a default value for ENUM fields in PHP?


You do this the same way as you would set a default for any field, here is what you need to write in your code for the field definition when creating your table:

myfieldname ENUM('option1','option2') default 'option2'

More mysql PHP Questions

How do I update the contents of a table row?
How do I return a random row from the database?
How do I delete a row from a table?
How do I connect to mySQL from PHP?
How do I find the longest value in my mysql table?