public string | ** fetchColumn (string $sqlQuery, [array $placeholders], [int | string $column])
Returns the n’th field of first row in a SQL query result
//Getting count of robots $robotsCount = $connection->fetchColumn("SELECT count(*) FROM robots"); print_r($robotsCount); //Getting name of last edited robot $robot = $connection->fetchColumn("SELECT id, name FROM robots order by modified desc", 1); print_r($robot);
Please login to continue.