Debt Consolidation - Wordpress Themes - Credit Reports - Paintball guns - Advertising

PDA

View Full Version : 2006/7 interpret as 2006 divide by 7 instead of a string


rosytoes
Aug 9th 2006, 6:55 am
I have $temp="2006/7"; I insert this into a table field where its datatype is char(12). However, this seems to be interpreted as 2006 divided by 7 instead of putting the string in the table. Is there a way to force "2006/7" to be read as a string?

haentz
Aug 9th 2006, 7:13 am
Is PHP doing this wrong or the Database? If the DB field is a char it shouldn't be the DB. Weird... But that's why I don't like the not type-safe PHP scripting language ;)

Try this in your PHP script: $temp="2006"."/7";


Kind regards, Hans

rosytoes
Aug 9th 2006, 7:59 am
Finally got it to work. I had set the default of that field to 2006/7, it was actually storing 286.57 in the database. I took the default out and $temp="2006/7"; work fine.