Code Comments
Programming Forum and web based access to our favorite programming groups.> --- "Ford, Mike" <M.Ford@leedsmet.ac.uk> wrote: > Mike are you saying that I should put single quotes > around all values regardless of the type ? > The double commas are happening because around an int > I don't use 'value' the single quotes . ? Don't know about other database engines, but in MySQL, it doesn't matter if an int is inserted as a string, i.e., with the quotes. My recollection is that MySQL handles the type conversion internally. So, assuming you are validating the entries before inserting, if a value is missing, assign to it ''. Whatever the field has as a default value will then be inserted into the table. dave
Post Follow-up to this message--- dpgirago@mdanderson.org wrote: > Don't know about other database engines, but in > MySQL, it doesn't matter > if an int is inserted as a string, i.e., with the > quotes. My recollection > is that MySQL handles the type conversion > internally. So, assuming you are > validating the entries before inserting, if a value > is missing, assign to > it ''. Whatever the field has as a default value > will then be inserted > into the table. > > dave Well most of these fields are optional and in the db set to allow null. I went ahead and put '' around all the values so just in case. Though I know for a fact it was working without them before. Oh and yes it seems to be working now. Stuart
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.