Background info:
I am creating a class which will handle certain queries for me. One of these queries would be a SELECT query, where the user can select something based on a clause. I successfully retrieved the TYPES of the columns, but have no idea on how to actually decide based on the TYPE of the column which TYPE should be given to bind_param() (the first parameter).
My original plan was to cheap out and simply hard-code which argument should be given if the retrieved column type is a certain type.
Example of my original idea:
if ($type === "varchar") {
$aVariable = "s";
}
//OR USE A SWITCH, BUT YOU GET THE IDEA
bind_param($aVariable, $someOtherVar);
However this isn't something I am satisfied with because of numerous different reasons. So my question is:
Question:
How can I use the column TYPES (if it's possible) to determine whether the argument given to bind_param() should be one of the following types: "s, i, d, b", without having to hard-code that the retrieved type = a certain letter.