Jump to content

debug INSERT statement


ntroycondo

Recommended Posts

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');";

Link to comment
https://forums.phpfreaks.com/topic/214052-debug-insert-statement/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.