I am trying to insert data into mysql database, this is an email registration with verification. The unique random number is not inserting into the database table. Please help me. Thanks a bunch.
else {
$user_confirm = md5(uniqid(rand()));
echo "$user_confirm";
//the form has been posted without, so save it
//notice the use of mysql_real_escape_string, keep everything safe!
//also notice the sha1 function which hashes the password
$sql = "INSERT INTO users(
user_name,
user_pass,
user_email,
user_date,
user_level,
user_confirm
)
VALUES('" . mysql_real_escape_string($_POST['user_name']) . "',
'" . sha1($_POST['user_pass']) . "',
'" . mysql_real_escape_string($_POST['user_email']) . "',
NOW(),
0,
'$user_confirm'
)";
$email = $_POST["user_email"];
$result = mysql_query($sql);