Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple MySQL Question

Status
Not open for further replies.

milams

Programmer
May 28, 2004
32
US
Hi All,

I have an "INSET INTO" question. When I want to insert data from a form into my database, do I have to list all of the columns that are in the database? And do they have to be in order, the way that they are listed in the database.
 
1) you will need to insert any fields that are not allowed to be null, unless they have a specified default value.

2) using the following format, you can insert them in any order you please:

Code:
insert
  into table (col5, col3, col2, col4, col9)
values ('col5val', 'col3val', 'col2val', 'col4val', 'col9val');



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Thanks, That's what I thought. I have it set that way, but it will still insert the record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top