Entry to mysql database

Hey,

I really don’t get this to work.
Whenever i submit my form, a new entry is saved, though “title” and “entry” value isn’t saved in the database, just the actual ID of the newly created post:

	$sql = "INSERT INTO entries (title, entry) VALUES (?, ?)";
		$stmt = $db->prepare($sql);
		$stmt->execute(array($_POST['$title'], $_POST['$entry']));
		$stmt->closeCursor();

Have you tried checking that $_POST[’$title’] and $_POST[’$entry’] contain the data you think they do?

Im guessing those should be $_POST[‘title’], $_POST[‘entry’]

Sponsor our Newsletter | Privacy Policy | Terms of Service