I have a project due tomorrow, and have been up til late working on this. can anyone tell me what is wrong with this code? This is the error I get
for the code
<?php
session_start();
$text = $_POST['message'];
$user = $_SESSION['username'];
$user2 = $_GET['user'];
$date = date('F j, Y, h:i A');
$con = mysql_connect("localhost","ZackBabtkis","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
mysql_query("INSERT INTO comments (username,from,message,date)
VALUES ('$user2','$user','$text','$date')") or die('Error: ' . mysql_error());
mysql_close($con);
header("location: /users/$user2");
?>