nvolungis Posted June 30, 2008 Share Posted June 30, 2008 I'm using MYSQL v 5.0.51a PHP v 5.2.5 I get this error: Error: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined which is generated when I run this code: $Index_in = 7; $Last_in = 'Hanks'; $First_in = 'James'; try { $dbh = new PDO($dsn, $user, $password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql ='INSERT INTO `Table` (Index, Last, First) VALUES (:Index_in, :Last_in, :First_in)'; $stmt = $dbh->prepare($sql); $stmt-> bindParam(':Index', $Index_in); $stmt-> bindParam(':Last', $Last_in); $stmt-> bindParam(':First', $First_in); $stmt-> execute(); } I'm learning and this looks analogus to the book's example. Any Ideas? Quote Link to comment Share on other sites More sharing options...
fenway Posted July 2, 2008 Share Posted July 2, 2008 Which line? Quote Link to comment 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.