[thelist] MySQL insert fails

Joel Canfield joel at spinhead.com
Sun Jul 7 19:30:01 CDT 2002

> try what I have done here, print the query, and make sure it
> looks correct. It is a good way to do error checking. You
> need SINGLE quotes on all values whether they are hard coded
> or variables.

Good idea. I do it with VBScript; didn't think of it here.

 I have never done what you are doing, listing
> the values into specific fields of the db.When I am not
> filling all of the fields, I put single quotes around a blank
> for the one I am skipping, so I never list all of the fields.

Habit. Never ask the db to do more thinking than necessary, and that way I
don't have to remember the default order as long as I put something in all
the fields.

> And what is the NULL for the id? If you are autoincrementing
> the id, you need to put a zero there, the way I have in my
> query.

PHP manual says NULL is recommended, 0 is acceptable. But yours works and
mine doesn't, so I'll try it your way ;)

Thanks again, Nan.


More information about the thelist mailing list