The code below isn't inserting into the db.
I've tried variations of it - sometimes getting a vague error, sometimes getting no output... but never actually working and inserting into the table.
I've tried combining the pages (form and processing), using php_self and script_name. Tried using mysql_query and $sql - etc...
I can write to the table inside phpmyadmin, so it is probably the code. Does anyone see anything that would give an error or cause it to not write to the table?
<form action="d-dbconnect.php" method="post">
who: <input type="text" name="name" />
site: <input type="text" name="site" />
what: <input type="text" name="comment" />
<input type="submit" value="post" />
</form>
...and here's the d-dbconnect.php
<?php
mysql_connect("localhost","root","xxxxxxxx") or die(error connecting);
mysql_select_db("feedback") or die(error selecting database);
$sql = "INSERT INTO index (site, name, comment) VALUES('$_POST[site]','$_POST[name]','$_POST[comment]')";
mysql_query($sql) or die(updating);
echo "Data Inserted";
?>
When it errors out, it grabs the values from the form, but says something like sql syntax error near 'index' ('site', 'name', 'comment') VALUES('sitefromform','namefromform','commentfromform')