PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

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'

Comment on this Question and Answer >>>

ASK A QUESTION

More mysql PHP Questions

How do I connect to mySQL from PHP?

How do I find second highest value from a table?

I am unable to make pages for my search result.Below I am giving the code that I am using. Career Search result Yami says

What is difference between mysql_fetch_array and mysql_fetch_object?

How do I update the contents of a table row?



Custom Search