<HTML>
<HEAD>
<TITLE> MySQLMan Help - Define Column Structure</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

<H1><font face="Verdana, Arial, Helvetica">MySQLMan Help</font></H1>

<TABLE width=100%>
<TR>
<TD align="right" valign="top">
<HR>
<B>
<a href="<%script_url%>?<%do_param%>=help&help_topic=toolbar"><font face="Verdana, Arial, Helvetica" size="2">Tool bar</font></a>
</B>
&nbsp;&nbsp;&nbsp;
<B>
<a href="<%script_url%>?<%do_param%>=help&help_topic=home"><font face="Verdana, Arial, Helvetica" size="2">HOME</font></a>
</B>
</TD>
</TR>
</TABLE>
<TABLE width=100% cellpadding=20>
<TR><TD>





<H2><font face="Verdana, Arial, Helvetica">Define Column Structure</font></H2>
<FONT face="Verdana, Arial, Helvetica" size="2">
<P>
After having specified the name of the table to be 
<a href="<%script_url%>?<%do_param%>=help&help_topic=create_table">created</a> or the number of fields to <a href="<%script_url%>?<%do_param%>=help&help_topic=add_col">add</a> to existing table,
you will be prompted to define the structure of the table.
The number of rows of the form will equal to the number fields you specified in the previous page.  Fill the fields accordingly to specify the structure of the table and press "Create Table"/"Add Column" to create 
the table/add the columns.  Please note that all rows must be filled, otherwise an error will occur.
<P>
For more details regarding to CREATE TABLE... query, please refer to MySQL online reference at <a href="http://www.mysql.com/Manual_chapter/manual_Reference.html#CREATE_TABLE">
http://www.mysql.com/Manual_chapter/manual_Reference.html#CREATE_TABLE</a>
<P>
For more details regarding to ALTER TABLE... ADD [COLUMN]... query, please refer to MySQL online reference at 
<a href="http://www.mysql.com/Manual_chapter/manual_Reference.html#ALTER_TABLE">
http://www.mysql.com/Manual_chapter/manual_Reference.html#ALTER_TABLE</a>
</P>
<UL>
	<li>
	<B>The form</B>
	<UL>
		<B>Field</B>
		<BR>Put field names here.  For details on legal names, please refer to MySQL online manual at
		<a href="http://www.mysql.com/Manual_chapter/manual_Reference.html#Legal_names">
		http://www.mysql.com/Manual_chapter/manual_Reference.html#Legal_names</a>
		<P>
		<B>Type</B>
		<BR>Specify the column types here from the list.  For details on column types, please refer to 
		<a href="http://www.mysql.com/Manual_chapter/manual_Reference.html#Column_types">
		http://www.mysql.com/Manual_chapter/manual_Reference.html#Column_types</a>
		<P>
		<B>Length/Set</B>
		<BR>For types like CHAR or INT, you will need to specify lengths for them.  To have INT(10),
		you should have 'INT' selected under column <B>Type</B> and '10' under column <B>Length/Set</B>.
		<P>
		If a field is given a type SET or ENUM, then you need to specify the options here as well.  You must quote 
		each option with single quotes and escape characters with a back-slashes (\).  In addition. the options should be separated by commas.  Please refer to the end of the page for an example.
		<P>
		<B>Attributes</B>
		<BR>Attributes for numeric types
		<P>
		<B>Null</B>
		<BR>NUll if null values are allowed in the field, NOT NULL otherwise.
		<P>
		<B>Default</B>
		<BR>Default value for the field.
		<P>
		<B>Extra</B>
		<BR>Set the field auto_increment.
		<P>
		<B>Primary/Index/Unique</B>
		<BR>Check the checkboxes to make the fields primary/index/unique keys.
	</UL>
	</li>
	<P>
	<li>
	<B>An example</B>
	<BR>To create a table with the following query
	<blockquote>
	<font size="2">
	CREATE TABLE <i>new_table</i> (<BR>
	    &nbsp;&nbsp;&nbsp;ID int(10) unsigned NOT NULL auto_increment,<BR>
		&nbsp;&nbsp;&nbsp;Color enum('red','blue','yellow') NOT NULL,<BR>
		&nbsp;&nbsp;&nbsp;Features set('A\\C','power lock'),<BR>
		&nbsp;&nbsp;&nbsp;PRIMARY KEY (ID)<BR>
	)<BR>
	</font>
	</blockquote>
	Fill the form as follows:
	<BR>(Note that you need to escape '\' with '\' in column <B>Length/Set</B> for field 'Features')
	<blockquote>
	<img src="mysql.cgi?<%do_param%>=help&help_topic=col_def.jpg">
	</blockquote>
	</li>
</UL>
</FONT>






</TD>
</TR>
</TABLE>
<TABLE width=100%>
<TR>
<TD align="right" valign="top">
<B>
<a href="<%script_url%>?<%do_param%>=help&help_topic=toolbar"><font face="Verdana, Arial, Helvetica" size="2">Tool bar</font></a>
</B>
&nbsp;&nbsp;&nbsp;
<B>
<a href="<%script_url%>?<%do_param%>=help&help_topic=home"><font face="Verdana, Arial, Helvetica" size="2">HOME</font></a>
</B>
<HR>
</TD>
</TR>
<TR>
<TD>
<font face="Verdana, Arial, Helvetica" size="2">
Related topics: 



<a href="<%script_url%>?<%do_param%>=help&help_topic=create_table">Create table</a> , 
<a href="<%script_url%>?<%do_param%>=help&help_topic=add_col">Add fields</a>



</font>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
