stevieontario Posted February 23, 2010 Share Posted February 23, 2010 Afternoon Freaks, I have been getting a weird INSERT query result. I put data into a table using the following query: $cquery = "insert into performance2 (sourceId, column1, column2, column3, column4) VALUES ('$lastSid', '$value1', '$value2', '$value3', '$value4')"; mysql_query($cquery, $cxn); The table performance2 contains an id field (perfid) which is an auto-incremented, indexed, primary key. When I run that query, everything works -- except that all the perfid rows are filled with "binary_file.dat". I've never seen this before, and I've tried googling the problem and still can't find out what's going on. Anybody have any ideas? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/ Share on other sites More sharing options...
Mchl Posted February 23, 2010 Share Posted February 23, 2010 What's 'perfid'? It's not in your code. Most likely you misassigned a value to variable somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/#findComment-1017024 Share on other sites More sharing options...
stevieontario Posted February 24, 2010 Author Share Posted February 24, 2010 whoops sorry, perfid is my auto incremented primary key column for the table performance2. Since it's auto-incremented, I don't include it in the insert. Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/#findComment-1017116 Share on other sites More sharing options...
Mchl Posted February 24, 2010 Share Posted February 24, 2010 If it's auto_increment, it has to be integer. If it's integer, it cannot hold value like 'binary_file.dat'. Please post table structure here (use 'SHOW CREATE TABLE performance2' query and paste results here). Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/#findComment-1017267 Share on other sites More sharing options...
stevieontario Posted February 25, 2010 Author Share Posted February 25, 2010 Thanks Mchl, and sorry for the delay (computer problems related to office move). Here's the table structure: performance2 CREATE TABLE `performance2` ( `perfid` int(125) ... Hope this helps, Steve Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/#findComment-1018118 Share on other sites More sharing options...
Mchl Posted February 25, 2010 Share Posted February 25, 2010 1. INT(125) is nonsense. 2. I can't see it marked as AUTO_INCREMENT (perhaps you cut it off) 3. As said before, INT column cannot hold anything like 'binary_file.dat'. I'm not sure what to think about it. Where exactly do you see this? Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/#findComment-1018155 Share on other sites More sharing options...
stevieontario Posted February 25, 2010 Author Share Posted February 25, 2010 As always, thanks for your time. I did the "show create table performance2" query in phpMyAdmin, and just copied the results. "Binary_file.dat" appears in each field in the perfid column when I click on the performance2 table in phpMyAdmin, in Browse mode. Quote Link to comment https://forums.phpfreaks.com/topic/193125-binary_filedat-inserted-into-auto-increment-field-instead-of-a-number/#findComment-1018166 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.