Thanks for help with a 'proper' insert. ;-)
Yes, the full statement works fine. (I assume this is something like the not setting default values from importing DATA files?) All a bit of a shame, as I'm executing the insert from a PHP script, and was trying to make the routine as generic as possible. I will now have to supply a field list to the function in addition. Ah well ;-)
Apologies for wasting your time with such a newbie-esque question.
rgrds
dd
On 5 Jan 2004, at 12:51, Jay Blanchard wrote:
[snip] insert into property values ('','Book-keeper\'s Cottage','Thu'); insert into property values ('','Inglenook Barn','Fri'); insert into property values ('','Maggie\'s House','Fri'); insert into property values ('','Riverside View',''); insert into property values ('','The Manse',''); insert into property values ('','Heathside',''); select * from property;
+-------------+-----------------------+-----------+ | property_id | name | changeday | +-------------+-----------------------+-----------+ | 1 | Book-keeper's Cottage | Thu | | 2 | Inglenook Barn | Fri | | 3 | Maggie's House | Fri | | 4 | Riverside View | | | 5 | The Manse | | | 6 | Heathside | | +-------------+-----------------------+-----------+ 6 rows in set (0.00 sec) [/snip]
All expected and correct behaviour. Why? Because you're specifying a blank for the third value in the insert statement.
insert into property values ('','Heathside',''); insert into property values BLANK, Heathside, BLANK;
A proper insert looks like this (without spec'ing a changeday)
INSERT INTO property (property_id, name) VALUES ('', 'Heathside')
Try that and let us know.
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]