PHP MySQL - INSERT issue
Posted: Thu Aug 28, 2003 10:19 pm
I dont know why, but this code doesent insert any data into my db.
its probably somthing small. but i have no idea what it is.
also, when it runs through phpMyAdmin's sql page, it works fine.
any help is appreciated.
its probably somthing small. but i have no idea what it is.
also, when it runs through phpMyAdmin's sql page, it works fine.
Code: Select all
if($_POST["submit"])
{
$username = $auth->userdata["username"];
$title = $_POST["title"];
$content = $_POST["content"];
$query = "INSERT INTO news (newsid, username, title, date, content, editdate) VALUES ('', '$username', '$title', UNIX_TIMESTAMP(), '$content', '0')";
$db->query($query);
echo "News posted successfully.";
break;
}