16 ms·
also, if you're using PDO: $stmt = $dbh->prepare( 'SELECT foo, bar from fooBar where foo = :fooValue' ); $stmt->bind( ':fooValue', $foo ); $stmt->execute();
by mustaphamond 17y ago
also, if you're using PDO:
$stmt = $dbh->prepare( 'SELECT foo, bar from fooBar where foo = :fooValue' );
$stmt->bind( ':fooValue', $foo );
$stmt->execute();
- randallsquared 17y agoIf you're using PDO, it's usually going to be easier to do: $stmt = $dbh->prepare( 'SELECT foo, bar from fooBar where foo = ?' ); $stmt->execute($foo); The only case where using named parameters is really useful is when there are so many parameters you're reduced to counting question marks.