作为我正在创建的脚本的一部分来更新从我的供应商发送的文件中的库存数据我被卡在sql代码上如何将其更新到数据库这是我的代码到目前为止:
// Get the pricelist into an array.
$lines = file($filename);
// Loop through our array
$stock=array("Y"=> "60", "N"=> "0", "C"=> "1");
foreach ($lines as $line_num => $line) {
echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<BR>\n";
$column = explode ( '"~"', $line ); // use the "~" as explode char
echo $column[0] . " sku <BR>";
echo $stock[$column[1]] . " stock <BR>"; //match short code to full text
// etc
// Connect to Local Database
// update data in mysql database
$sql="UPDATE oc_products Where sku='".$column[0] ."', quantity='".$stock[$column[1]]."' WHERE '[$column[0]'. ='".$column[0]."'";
提前致谢