I like naming the fields...

insert into product (
NumUsers,DataConnect,Type,NumRouters,NumSwitches,AvgServiceCallsWk ) values
( '456789','t1','new',2,2,10 )

I use php on a large web app that from time to time I have to add a field to
a table.  If I use the above syntax instead of w/o field names, by adding a
field to the db it breaks my insert pages.  So if I have 15 pages that
insert into that table I have to go to each one and change the code.  By
referencing the names as above, when you add a new field to the table, you
get no errors.  Of course this is only helpfull when the new field isn't
something that those 15 php pages needs to add, but that happens all the
time and saves me a bit of work.

Hope that helps..

Larry

-----Original Message-----
From: Mike Mapsnac [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 04, 2004 10:09 AM
To: [EMAIL PROTECTED]
Subject: insert: auto increment field


I have table with 7 fields. First field is id (auto increment). As I
understand the value should start from 0 and  next value will auto
increment.

And I shouldn't add insert the value. So the insert
statemens below gives me an error. ERROR 1136:Column count doesn't match
value count at row 1

insert into product values('456789','t1', 'new', 2, 2, 10);

_________________________________________________________________
Have fun customizing MSN Messenger — learn how here!
http://www.msnmessenger-download.com/tracking/reach_customize


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to