jmac2501 Posted June 7, 2007 Share Posted June 7, 2007 I am using a custom php program for my website to track game stats. It stores stats in my database and my website calles them from there. The problem is that i can seem to get it to work right. all of the php scripts are usign open strings like this: DBQuery("INSERT INTO $maps_table VALUES (' ', '".base64_encode("Crude City Conflict")."', 'maps/crudecityconflict_big.jpg', 'maps/crudecityconflict_thumb.jpg', '', '', '', 'Deathmatch', '');"); and MYSQL 5.0 dosn't like this i keep getting Out of range value adjusted for column 'id' at row 1 errors. My question is there a way to fix this without placing somthing into this open string like a "0" ('0', ....) I would like to keep the scripts the way they are. Quote Link to comment https://forums.phpfreaks.com/topic/54625-mysql-50-and-open-strings/ Share on other sites More sharing options...
wildteen88 Posted June 7, 2007 Share Posted June 7, 2007 Use the NULL keyword if entering an empty string. Or list just the columns you are inserting data into the table (recommended).Eg: INSERT INTO tbl_name (col1, col2, col3, etc) VALUES ('valueCol1, 'ValueCol2, 'ValueCol3 etc...) Quote Link to comment https://forums.phpfreaks.com/topic/54625-mysql-50-and-open-strings/#findComment-270149 Share on other sites More sharing options...
jmac2501 Posted June 7, 2007 Author Share Posted June 7, 2007 Yeah thats how i would do it but all of the scripts are pre made without the that in them... looks like i will need to mod them. Quote Link to comment https://forums.phpfreaks.com/topic/54625-mysql-50-and-open-strings/#findComment-270253 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.