I have a database test with table name table with two columns user & email.
Whats wrong with my below code? Am not able to add the array $u to my db
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$user = "safwan";
$email = "[email protected]";
$u = array ( user => $user,
email => $email
);
$q = "INSERT INTO table VALUES ($u)";
mysql_query($q) OR die(mysql_error());
mysql_close($con);
?>