I've looked in provided file example.php and saw this line:
$rows=$db->fetch("SELECT * FROM my_table WHERE col1=?","s","12","Value1");
col1 = ? requires a value, but the parameters provided are 3. What's the meaning of three parameters?
More explanation is really appreciated.
$data_types: Data types to be binded for execution."s" for string, "i" for integer, "b" for bool.Each character is assigned to a value.No space between characters.For example:
"s" is assigned to $value1
"i" is assigned to $value2
"b" is assigned to $value3
$lengths: Lengths to be binded for execution.Each number is assigned to a value.Numbers are separated by ":".For example:
10 is assigned to $value1
5 is assigned to $value2
12 is assigned to $value3
$value: Value to be binded for execution.You must pass the same number of values as the data types and lengths.
If you don't need to bind parameters you may use:
Hope I helped.Let me know if you have more questions.