<?php
while ($data = $stmt->fetch( PDO::FETCH_ASSOC ))
echo "{$data['date']}";
echo "{$data['user_id']}";
echo "{$data['hours']}";
?>
<?php
while ($data = $stmt->fetch( PDO::FETCH_ASSOC ))
{
echo "{$data['date']}";
echo "{$data['user_id']}";
echo "{$data['hours']}";
}
?>
Только начинаю изучение построения сетей.
Пробовал такой запрос, но это не совсем то, что нужно.
Но что-то не совсем то.
$sql = "SELECT SUM(manager_comment) as summa FROM Users WHERE courier=1 AND delivery_date='$delivery_date' AND delivery_status=1";
SELECT
car1,
car2,
t1.garage
FROM (SELECT
MIN(car) car1,
garage
FROM garages
GROUP BY garage) t1
JOIN (SELECT
MAX(car) car2,
garage
FROM garages
GROUP BY garage) t2
ON t1.garage = t2.garage
WHERE car1 <> car2
$pdo=new PDO(тут ваши данные для подключения к БД);
$result=$pdo->prepare("SELECT count(email) as cnt FROM clients WHERE email=:email GROUP BY email");
$result->execute(array(":email" => "bill@microsoft.com"));
print $result->rowCount();
$pdo=new PDO("mysql:dbname=test;host=localhost", "root", "");
$result=$pdo->prepare("SELECT count(email) as cnt FROM clients WHERE email=:email GROUP BY email");
$result->execute(array(":email" => "bill@microsoft.com"));
$row= $result->fetchAll(PDO::FETCH_ASSOC);
pritn $row[0]['cnt'];
$pdo=new PDO("mysql:dbname=test;host=localhost", "root", "");
$result=$pdo->prepare("SELECT 1 FROM clients WHERE email=:email");
$result->execute(array(":email" => "bill@microsoft.com"));
print $result->rowCount();