florienb Posted April 29, 2011 Share Posted April 29, 2011 Hello, I am currently trying to learn php from a book called PHP for Absolute Beginners where it teaches you how to build a blog by "hand". All nice and good until i got to the submit an entry and save it to my database process. I'm using PDO with INSERT prepared statement like so, from a separate update.inc.php file: $sql = "INSERT INTO entries (title, entry) VALUES (?,?)"; $stmt = $db->prepare($sql); $stmt -> execute(array($title, $entry)); $stmt ->closeCursor(); I have attached screenshots of my database in mysql. What could be the problem? Remeber I am an "ABSOLUTE BEGINNER" . Thank you [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/235067-pdo-prepared-statements-inserting-null-values-in-my-db/ Share on other sites More sharing options...
florienb Posted April 30, 2011 Author Share Posted April 30, 2011 great support on this forum.. thankfully a friend solved this for me. Quote Link to comment https://forums.phpfreaks.com/topic/235067-pdo-prepared-statements-inserting-null-values-in-my-db/#findComment-1208577 Share on other sites More sharing options...
PFMaBiSmAd Posted April 30, 2011 Share Posted April 30, 2011 I'm sure you provided your friend with a lot more information about the code and variables that was causing the problem than what you supplied here. When the post that starts a thread doesn't contain all the relevant code and information needed to solve them, a lot of threads just go unanswered and fall off the front page of the forum. Don't complain if someone didn't feel like taking the time to ask you to post relevant code and information about the problem that you didn't take the time to include in the first post in the thread. Quote Link to comment https://forums.phpfreaks.com/topic/235067-pdo-prepared-statements-inserting-null-values-in-my-db/#findComment-1208634 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.