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
For people who come here seeking a literal answer.
Use bindColumn
PDOStatement::bindColumn — Bind a column to a PHP variable
using the example from the same source :
function readData($dbh) { $sql = 'SELECT name, colour, calories FROM fruit'; try { $stmt = $dbh->prepare($sql); $stmt->execute(); /* Bind by column number */ $stmt->bindColumn(1, $name); $stmt->bindColumn(2, $colour); /* Bind by column name */ $stmt->bindColumn('calories', $cals); while ($row = $stmt->fetch(PDO::FETCH_BOUND)) { $data = $name . "\t" . $colour . "\t" . $cals . "\n"; print $data; } } catch (PDOException $e) { print $e->getMessage(); } } readData($dbh);