Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- php adodb error type mismatch on parameterized query
- if (isset($_POST['submit'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "select user_id from users where user_id = '?' and PWD = '?'";
- $params = array($username, $password);
- $execute = $conn->Execute($query,$params) or die("Error in query: $query. " . $conn->ErrorMsg());
- if ($execute->EOF){
- echo 'fail';
- }
- else {
- echo 'yay';
- }
- }
- $conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
- $connStr = "PROVIDER=SQLOLEDB;SERVER=".$server.";UID=".$myUser.";PWD=".$myPass."; DATABASE=".$myDB;
- $conn->open($connStr); //Open the connection to the database
- Fatal error: Uncaught exception 'com_exception' with message 'Source: Provider Description: Type mismatch.' in C:CGI ScriptsSITESSkillSTICK_2011login.php:22 Stack trace: #0 C:CGI ScriptsSITESSkillSTICK_2011login.php(22): com->Execute('select user_id ...', Object(variant)) #1 {main} thrown in C:CGI ScriptsSITESSkillSTICK_2011login.php on line 22
Add Comment
Please, Sign In to add comment