i get this 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 'index, user_id, username, message) VALUES(' ', '4', 'zack', 'jh')' at line 1
<?php
session_start();
$_SESSION['user_id'] = 4;
$user_id = $_SESSION['user_id'];
$_SESSION['username'] = "zack";
$username = $_SESSION['username'];
$message = $_POST['shout_mes'];
$insert = $_POST['shout'];
if(!empty($message) && $insert = "shout"){
include('mysqlcon.php');
$select = mysql_select_db($db, $con);
if(!$select){
die('could not select db: ' . mysql_error());
}
$sql = mysql_query("INSERT INTO shoutbox (index, user_id, username, message) VALUES(' ', '$user_id', '$username', '$message')");
if(!$sql){
echo "error" . mysql_error();
}else{
header("location: index.php");
}
}else{
echo "there was an error: " . mysql_error();
}
?>