Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- bindParam



  A trap in PDOStatement::bindParam

First, let's check out below codes: <?php $dbh = new PDO('mysql:host=localhost;dbname=test', "test"); $query = <<prepare($query); $bind_params = array(':username' => "laruence", ':password' => "weibo"); foreach( $bind_params as $key => $value ){ $statement->bindParam($key, $value); } $statement->execute(); What is the SQL executed finally? Is there any problem with above codes? Many people may think the query executed is : INSERT INTO `user` (`username`, `password...

   PHP,Trap,bindParam     2013-08-29 10:48:55