It has come to my attention that a few people have been stumbling upon how to use the ‘LIKE’ command with wildcards using this database class. Because of this, I will provide a brief sample of how to use it.
Normally when someone writes a query which uses ‘LIKE’, it is written as follows:
$query = "SELECT `email` FROM `users` WHERE `username` LIKE '%Tom%'"; $res = $db -> query ( $query );
However, because of how this database class currently works, this will cause issues (it looks for the percent sign (%) and then tries to find a parameter type to bind to it). So instead of doing it this way, you must do the following:
$query = "SELECT `email` FROM `users` WHERE `username` LIKE %s"; $res = $db -> query ( $query, '%Tom%' );
This will bind the wildcards along with the actual value into the query and end up doing exactly what you need it to do.
Sorry for the inconvenience.