Answer the question
In order to leave comments, you need to log in
Does Google have api that allows you to display such cards on your site (as in the screenshot)?
Does Google have api that allows you to display such cards on your site (as in the screenshot)? Let's say I have a search box from Google directly on the site, I will drive in a request, and under this line I will see such a card.
Answer the question
In order to leave comments, you need to log in
<?php
/* создаем соедиенение с бд*/
$link = mysqli_connect("localhost", "root", "", "test");
/* для примера возьмем такой doctorid*/
$doctorid = 2;
/* создаем подготавливаемый запрос */
$stmt = mysqli_stmt_init($link);
$sql = '
SELECT
cal.`doctorid`,
doc.`doctor-name`,
cal.`clinicid`,
clin.`clinic-name`,
cal.`start`,
cal.`end`
FROM
`bio_vet_calendar` cal
JOIN `bio_vet_clinic_department` clin ON cal.`clinicid` = clin.`clinicid`
JOIN `bio_vet_doctor` doc ON cal.`doctorid` = doc.`doctorid`
WHERE
cal.`doctorid` = ?
';
if (mysqli_stmt_prepare($stmt, $sql)) {
/* привязываем переменные к параметрам */
mysqli_stmt_bind_param($stmt, "i", $doctorid);
/* выполняем запрос */
mysqli_stmt_execute($stmt);
/* выбираем данные из результата */
$response = mysqli_stmt_get_result($stmt);
/* преобразовываем в ассоциативный массив*/
$result = mysqli_fetch_all($response, MYSQLI_ASSOC);
/* закрываем запрос */
mysqli_stmt_close($stmt);
}
/* закрываем соединение с бд*/
mysqli_close($link);
/* выводим JSON */
echo json_encode($result);
Answer to the question How to withdraw:
But the problem is that you don't have any data yet, you haven't made a request yet.
To learn how to write a query that returns the desired data, ask a separate question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question