我需要将以下数组插入到具有列名称、标题、网址、徽标的 mysql 表中。我创建了表并编写了一个查询来传输数组。但它正在插入数组的最后一行并留下剩余的......请帮助我......这是我的数组
$con = mysql_connect("localhost","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("media", $con);
$featured = array();
$featured[] = array('name' => '', 'title' => '', 'url' => '', 'logo' => '');
$featured[] = array('name' => '', 'title' => '', 'url' => '', 'logo' => '');
$featured[] = array('name' => '', 'title' => '', 'url' => '', 'logo' => '');
$featured[] = array('name' => '', 'title' => '', 'url' => '', 'logo' => '');
$sql = "INSERT INTO featured";
$sql .= " (`".implode("`, `", array_keys($featured))."`)";
$sql .= " VALUES ('".implode("', '", $featured)."') ";
$result = mysql_query($sql) or die(mysql_error());