Outputting a select count(name) value in php pdo with mySql -


$stmt = $conn->prepare('select count(names) names names names = :name'); $stmt->bindparam(':name', $name); $stmt->execute(); 

how output value of names when doing select count() using pdo without having use while loop or similar?

i need count value of names (1, 3 or 5 or whatever is).

$count = $stmt->fetchcolumn(); 

fetchcolumn()


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -