Page 1 of 1

PHP MySQL - INSERT issue

Posted: Thu Aug 28, 2003 10:19 pm
by Black Majic
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.

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;
			}
any help is appreciated.

Posted: Fri Aug 29, 2003 3:17 am
by JayBird
does this line definately equate to TRUE?

Code: Select all

if($_POST["submit"])
Mark

Posted: Fri Aug 29, 2003 9:18 am
by Black Majic
Thank you!

ugh, i forgot to add name="submit" on my submit button :x