For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > November 2004 > RE: [PHP-DB] Transaction suddenly not working









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Transaction suddenly not working
dpgirago@mdanderson.org

2004-11-29, 3:59 pm

> --- "Ford, Mike" <M.Ford@leedsmet.ac.uk> wrote:

[color=darkred]
> 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
Stuart Felenstein

2004-11-29, 3:59 pm


--- dpgirago@mdanderson.org wrote:

[color=darkred]
> 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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com