I have no clue why this isn't working.
<?php
if(isset($_GET['commented']))
{
$hostname="[SNIP]";
$username="[SNIP]";
$password="[SNIP]";
$dbname="[SNIP]";
$table="updates";
$link = mysql_connect($hostname, $username, $password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname);
$name = $_GET['uname'];
$update = $_GET['uupdate'];
$date=date( 'l F d Y' );
$time=date( 'B' );
echo "<br />Thank you for updating, you lazy slob!<br />";
echo $name;
echo $update;
echo $time;
echo $date;
$query = "INSERT INTO updates (name, time, date, update) VALUES ('$name', '$time', '$date', '$update')";
mysql_query($query) or die();
} else {
echo "<br />Please post your latest update here.<br />";
}
?>
<form method="get" action="<? echo $PHP_SELF; ?>">
Name: <input type='text' name='uname'> <br><br>
Update: <input type='text' name='uupdate'> <br><br>
<input type='hidden' name='commented' value='set'>
<input type='submit' value='Post your update'></form>
EDIT: I went back and had it return the error after the query, and got this message:
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 'update) VALUES (test, 428, Sunday March 05 2006, test)' at l
....I don't see the error.