Simple INSERT INTO Query won't work
Posted: Thu Oct 29, 2009 6:11 pm
Hello Everyone,
This is likely the easiest problem to solve, however after hours of staring at this code I can't think anymore. The following query will not add my variables to my SQL database! However, an echo statement with the variables works fine.
$message = $_POST['message'];
$author = $_POST['author'];
$sql = "INSERT INTO Quotes (Quote, Author)
. VALUES ('$message', '$author')";
mysql_query($sql);
What am I missing?
Thank-you,
-Jonathan
This is likely the easiest problem to solve, however after hours of staring at this code I can't think anymore. The following query will not add my variables to my SQL database! However, an echo statement with the variables works fine.
$message = $_POST['message'];
$author = $_POST['author'];
$sql = "INSERT INTO Quotes (Quote, Author)
. VALUES ('$message', '$author')";
mysql_query($sql);
What am I missing?
Thank-you,
-Jonathan