0

I want to make a difference between big and small letters when checking if the key is correct. I have this query:

$stmt = $db->prepare("SELECT DISTINCT * FROM table WHERE id=? AND key=? 
COLLATE utf8_general_ci");
$stmt->bind_param("is", $id, $key);
$id = $_POST[id];
$key = $_POST["key"];
$stmt->execute();

With this, I get a message:

Fatal error: Call to a member function bind_param() on boolean

So what's wrong with my query?!

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

-1

It seems that mysqli can't deal with COLLATE properly. 'prepare' returns FALSE and you get the error. To be able to execute the statement you can use 'query' instead of 'prepare'

user2434435
  • 127
  • 5