I tried this code, I don't know why it shows some errors.
Quote:
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 '1' at line 1
|
and how to do, when it runs sucessfull and automaticality return to $_REQUEST['do'] == "add" ???
PHP Code:
// ### ADD ###
if ($_REQUEST['do'] == "add")
{
echo "<table border=\"1\" align=\"center\">
<tr>
<td><form action=\"$PHP_SELF?do=adding\" method=\"post\">
Title:<br/> <small>Example: American Pie 4</small></td>
<td><input type=\"text\" name=\"title\" value=\"Title\" onfocus=\"if (this.value == 'Title') this.value = '';\"/></td>
</tr>
<tr>
<td>If you're done, click Send!
<td><input type=\"submit\" value=\"Send\"/></form></td>
</tr>
</table>
";
}
// ### START ADDING ###
if ($_REQUEST['do'] == "adding")
{
$adding = $db->query("
INSERT INTO test (title)
VALUES ('$_POST[title]')
");
}