Guest User

Untitled

a guest
Aug 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. php adodb error type mismatch on parameterized query
  2. if (isset($_POST['submit'])){
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5. $query = "select user_id from users where user_id = '?' and PWD = '?'";
  6. $params = array($username, $password);
  7. $execute = $conn->Execute($query,$params) or die("Error in query: $query. " . $conn->ErrorMsg());
  8. if ($execute->EOF){
  9. echo 'fail';
  10. }
  11. else {
  12. echo 'yay';
  13. }
  14. }
  15.  
  16. $conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
  17. $connStr = "PROVIDER=SQLOLEDB;SERVER=".$server.";UID=".$myUser.";PWD=".$myPass."; DATABASE=".$myDB;
  18. $conn->open($connStr); //Open the connection to the database
  19.  
  20. 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