You can't execute multiple multiple queries with a call to mysql_query(). You need to break it up into multiple queries.
Code:
$query = "INSERT INTO $tbl_name
(SKU, prod_title, retail_price, best_seller, new_item)
VALUES
('$sku_element', '$title_element', '$price_element',
'$best_element', '$new_item_element')";
// EXECUTE FIRST QUERY
echo "First query: $query <br/>\n";
$result = mysql_query($query, $link_id));
$query = "INSERT INTO $tbl_name
(SKU, instrument, instrumentCategory)
VALUES
('$sku_element', '$inst_element', '$instCat_element');";
// EXECUTE SECOND QUERY:
echo "Second query: $query <br/>\n";
$result = mysql_query($query, $link_id));
Of course, this is where MySQL's lack of transactions really hurts developers who need to perform multiple queries as part of a single transaction.
If the first query succeeds but the second fails, you need to undo the first query. With a transactions-enabled database, this is easy; you just wrap both queries into a transaction.
With MySQL, though, transactions aren't supported using the default table type. Using the Inno DB table type slows things down a bit, but that's the price you pay when you need transaction support.
The other option is to manually mimic transactions in the code. If the first query succeeds and the second fails, run another query that deletes from $tbl_name where SKU = $sku_element, prod_title = $title_element, etc...
Of course, this isn't fool proof -- this rollback query might fail, too.
Take care,
Nik
http://www.bigaction.org/