ntroycondo Posted September 21, 2010 Share Posted September 21, 2010 I have a simple INSERT statement that isn't inserting anything into one of the columns: coin_name I've gone over everything and can't figure out why. All other columns get data. HTML form passes everything fine. Is there a good way to debug this? I've triple checked everything and there are no type-o's that I see. Driving me mad... $query = "INSERT INTO Coin (coin_name, coin_value, coin_condition, year_minted, face_value, purchase_price) VALUES ('$coin_name', '$coin_value', '$coin_condition', '$year_minted', '$face_value', '$purchase_price');"; Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/ Share on other sites More sharing options...
Pikachu2000 Posted September 21, 2010 Share Posted September 21, 2010 You have an extra semicolon inside the closing quote. Typo? Have you by chance echoed $query to make sure it contains the values you'd expect it to contain? If that looks OK, make sure the field name matches exactly, including capitalization, and that the field's data type is appropriate for what you're trying to insert. Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/#findComment-1113900 Share on other sites More sharing options...
ntroycondo Posted September 22, 2010 Author Share Posted September 22, 2010 I removed the extra ";" ... good catch. But it doesn't make a difference. echo $coin_name; returns nothing. if I echo any other, like $coin_value; it will return the correct string. Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/#findComment-1113915 Share on other sites More sharing options...
fenway Posted September 24, 2010 Share Posted September 24, 2010 I removed the extra ";" ... good catch. But it doesn't make a difference. echo $coin_name; returns nothing. if I echo any other, like $coin_value; it will return the correct string. Then you've got a php problem. Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/#findComment-1115147 Share on other sites More sharing options...
chintansshah Posted September 24, 2010 Share Posted September 24, 2010 Please paste your PHP code where you set the value of $coin_name, $coin_value...bla...blaaa Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/#findComment-1115165 Share on other sites More sharing options...
Pikachu2000 Posted September 24, 2010 Share Posted September 24, 2010 Please paste your PHP code where you set the value of $coin_name, $coin_value...bla...blaaa But please do so in the PHP help forum, or ask that this thread be moved there. Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/#findComment-1115175 Share on other sites More sharing options...
chintansshah Posted September 24, 2010 Share Posted September 24, 2010 Sorry Pikachu, who can move thread? Quote Link to comment https://forums.phpfreaks.com/topic/214052-debug-insert-statement/#findComment-1115178 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.