Focus mode
$sql = 'SELECT SUM(id) FROM test';
$query = $db->query($sql);
if ( $query->rowCount() ){
print_r($query->fetch(PDO::FETCH_ASSOC));
}
$sql = 'SELECT MIN(id) FROM test';
$query = $db->query($sql);
if ( $query->rowCount() ){
print_r($query->fetch(PDO::FETCH_ASSOC));
}```
##### MAX
$sql = 'SELECT MAX(id) FROM test';
$query = $db->query($sql);
if ( $query->rowCount() ){
print_r($query->fetch(PDO::FETCH_ASSOC));
}```
$sql = 'SELECT COUNT(id) FROM test';
$query = $db->query($sql);
if ( $query->rowCount() ){
print_r($query->fetch(PDO::FETCH_ASSOC));
}
$sql = "SELECT COUNT(id) toplam, soyisim FROM test GROUP BY soyisim HAVING toplam > 2";
$query = $db->query($sql);
if ($query->rowCount()) {
print_r($query->fetch(PDO::FETCH_ASSOC));
}
Programs to Accelerate Your Progress in a Software Career
Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!
You need to enroll in the course to be able to comment!