我有一个带有两列&test
的表名的数据库。我下面的代码有什么问题?我无法将数组添加到我的数据库table
user
email
$u
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$user = "safwan";
$email = "esafw@jdjd.com";
$u = array ( user => $user,
email => $email
);
$q = "INSERT INTO table VALUES ($u)";
mysql_query($q) OR die(mysql_error());
mysql_close($con);
?>