I am creating a visitor messages system on a member's profile, here is my code so far..
I am using it as an include in the profile page, here is the error I get:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
<?php
session_start();
include("database.php");
$uid = $_GET['Id'];
$pid = $_SESSION['Id'];
?>
<html>
<body>
<form method="POST" >
<p>
<b>Post Something: </b>
<textarea name="message" rows="10" cols="30">
"Write something here..."
</textarea></p>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
</body>
</html>
<?php
$message = $_POST['message'];
$insert="INSERT INTO wall_posts (user, poster, message)
VALUES
($uid,$pid,$message)";
if (!mysql_query($insert))
{
die('Error: ' . mysql_error());
}
header("location:member.php");
mysql_close($con)
?>