我正在尝试products
从另一个表 ( ) 更新表 ( table 1
)。但是,型号中有许多符号,包括“/”。数据导出工作得很好,除了有'/'的情况。而是将其转换为日期。
例如以下情况
11/08/1944 should be 11/08/44
11/07/1944 should be 11/07/44
以下是我所拥有的:
$query = mysql_query("SELECT `COL 1` AS id, `COL 7` AS model FROM `table 1` ORDER BY id ASC", $c2) or die(mysql_error());
while($r = mysql_fetch_array($query)):
$id = $r['id'];
$model = $r['model'];
mysql_query("UPDATE products SET model = '".mysql_real_escape_string($model)."' WHERE id = $id", $c1);
echo "MODEL: $model AND ID: $id <br />";
endwhile;