Using bind_paramfor all my queries, now I want to use IN(?)where the number of elements in the list can vary.
SQLout feature that I use here mainly performs $sql_db->prepare, ->bind_param, ->execute(), ->store_result(),->bind_result
$locations = ('a','b','c','d','e');
SQLout ("SELECT Name FROM Users WHERE Locations IN (?)",
array('s', $locations), array(&$usrName));
SQLout ("SELECT Name FROM Users WHERE Locations IN (?,?,?,?,?)",
array('sssss', $locations[0],$locations[1],$locations[2],$locations[3],$locations[4]), array(&$usrName));
Has anyone come up with a more elegant solution?
source
share