I am currently using joshcam's PHP-MySQLi-Database-Class which has quite a few stars and forks. However, even with all of the attention it gets, it seems like it's missing some features — or I am misunderstanding how to use it.
When I use the where clause function he created, the variables I input don't seem to have quotations around them. It's like I have to manually add the quotation marks to the beginning and end of the variables, even though they are prepared statements and that's counter intuitive.
I tried reaching him but no luck, so here I am.
Here's example code:
$db->where ('name', 'John Doe');
$results = $db->get ('users');
echo $db->getLastQuery();
Yet, here is what it outputs:
SELECT * FROM users WHERE name = John Doe
So unless I am missing something (and I carefully scanned the documentation), I am going to have to put quotes around every single variable in the where function? Why did he not incorporate this and why do so many people like this wrapper if such an obvious feature is missing? The whole benefit of prepared statements is that they handle the quotations and everything, so this is counter intuitive if I am doing it correctly.
EDIT: To take it one step further. On his documentation under the "Where" clause bit, it says:
OR CASE
$db->where ('firstName', 'John'); $db->orWhere ('firstName', 'Peter');
$results = $db->get ('users');
// Gives: SELECT * FROM users WHERE firstName='John' OR firstName='peter'
Yet when I place that exact code into my file and echo out the query, it shows no quotation marks still.