AbydosGater Posted October 31, 2006 Share Posted October 31, 2006 Hi, I was writing my script, and when i went to run it i got an error i have not seen before..Column count doesn't match value count at row 1.The script is a simple insert...mysql_query("INSERT INTO chat_messages (message_id, member_id, handle, ip, timestamp, message, type) VALUES (NULL , '0', '$ip', CURRENT_TIMESTAMP , '$handle has just logged out of chat', 'users') ") or die(mysql_error()); I dont think its anything to do with the code cause its comming up for all scripts i have running on this table!Why is this? and how do i fix it??#AbydosThanks Link to comment https://forums.phpfreaks.com/topic/25645-mysql-columns-not-matching-value-at-row-1/ Share on other sites More sharing options...
trq Posted October 31, 2006 Share Posted October 31, 2006 You trying to insert 6 values into 7 fields. Link to comment https://forums.phpfreaks.com/topic/25645-mysql-columns-not-matching-value-at-row-1/#findComment-117054 Share on other sites More sharing options...
AbydosGater Posted October 31, 2006 Author Share Posted October 31, 2006 Yay! Thanks for the fast reply!yes that worked to fix some of my problems..But on another insert, im still getting the error!mysql_query("INSERT INTO chat_messages (message_id, member_id, handle, ip, timestamp, message, type) VALUES (NULL , '0' '$handle', '$ip', CURRENT_TIMESTAMP , '$message', 'post') ") or die(mysql_error()); Im tired and might not be counting right, but i see 7 and 7 there?? Link to comment https://forums.phpfreaks.com/topic/25645-mysql-columns-not-matching-value-at-row-1/#findComment-117058 Share on other sites More sharing options...
trq Posted October 31, 2006 Share Posted October 31, 2006 Nope, 6. Your missing a , between '0' and '$handle'. Link to comment https://forums.phpfreaks.com/topic/25645-mysql-columns-not-matching-value-at-row-1/#findComment-117060 Share on other sites More sharing options...
AbydosGater Posted October 31, 2006 Author Share Posted October 31, 2006 Yayness.. Thanks thorpe! your a saviour! always answering my questions!Thanks Link to comment https://forums.phpfreaks.com/topic/25645-mysql-columns-not-matching-value-at-row-1/#findComment-117061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.