I\'m converting to PDO and Im using prepared statements, I want to bind my result as so $stmt->bind_result($email_count); so i am able to put this into an if
Here's my custom function:
function bindColumns($stmt, $columns){
if(!is_array($columns)) $columns=array($columns);
$count=count($columns);
for($i=0;$i<$count;$i++) $stmt->bindColumn($i+1, $columns[$i]);
}
And usage (variables by reference):
bindColumns($stmt, array(&$worker_id, &$password, &$salt));