Jump to content


Photo

setting default in mysql tables


  • Please log in to reply
1 reply to this topic

#1 aysx

aysx
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2003 - 12:52 AM

just a quick question because it slipped my mind

how do you set a default value for a column in mysql?

thanks

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 29 September 2003 - 05:12 AM

Try this.

sample  CREATE TABLE `sample` (          `Name` varchar(100) default \'TestName\',         `Age` decimal(10,0) default \'20\');

Also refer manual for more details and examples.

http://www.phpfreaks...mysqlmanual.php
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users