Jump to content

[SOLVED] Problem with INSERT'ing multiple values.


scott.stephan

Recommended Posts

I'm running this and everything looks 100% correct:

$qry_lots_id = "INSERT INTO lots_new(lot,lot_qty,lot_rec,lot_sku_id) 
VALUES($s_k_row[1],$s_k_row[0],$s_k_row[2],$s_k_row[3])";
$result = @mysql_query($qry_lots_id);

 

I ran an echo on the query and it outputs what I expect:

 

QUERY: INSERT INTO lots_new(lot,lot_qty,lot_rec,lot_sku_id) VALUES(RCP0195,998,1,2)

 

And yet nothing ends up in the table. The field names and table names are 100% correct. The code executes fine. It must be a syntax thing, but I'm not seeing it. Help?

String values must be enclosed in single-quotes.

 

And there is absolutely no reason to put an @ in front of a mysql_query() statement. Don't use @ in your code to suppress error messages, it just slows down your code, even when there is no error (yes, just putting the @ in your code, slows down your code.)

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.