I'm trying to make a function that I can use safely every time I wanna insert or update anything using PDO Here is what I have made $dbName = "mydb"; $dbServerAddress = "localhost"; $dbUsername = "root"; $dbPassword = "somepassword"; $dsn = "mysql:dbname=". $dbName .";'". $dbServerAddress ."'"; global $db; $db = new PDO($dsn,$dbUsername,$dbPassword); function ExecuteQuery2($query,$arrayOfValues){ global $db; $sth = $db->prepare($query); $sth->execute($arrayOfValues); print $sth-> errorCode(); print $sth-> errorInfo(); } PHP: And here is how I'm trying to use it $username = "blabla"; $email = "blabla@yahoo.com"; $password = "blabla"; $homepage = "http://www.blabla.com"; ExecuteQuery2("insert into users (`verified`,`username`,`email`,`password`,`avatarid`,`homepage`,`lastlogin`,`sentitems`,`passworddate`,`title`,`allowedtosend`,`changePassKey`) values (1, ? , ? , ? ,0, ? ,CURDATE(),0,CURDATE(),'',0,0)",array( $username , $email , $password , $homepage )); PHP: I receive this error when running the codE: 23000Array What seems to be the issue?