zagorisback

Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору PHP 5.6 У меня был бы другой запрос, я хотел бы отобразить дни рождения текущей даты (если есть) или еженедельных (если не присутствует) актеров в моей базе данных на стартовой странице со следующими спецификациями: визуализировать имя ета ' фото ссылка на карту (id) это поля имя varchar (45) фото варчар (100) дата рождения I would have another request, I would like to display the birthdays of the current date (if any) or weekly (if not present) of the actors in my database on the start page, with these specifications: visualize First name age' photo link to the card (id) these are the fields nome varchar (45) foto varchar (100) birthday date с этим я могу извлечь имена with this I can extract the names Код: <?php require_once("connetti.php"); // just returns the actor having a birthday function birthday_today() { $result = mysql_query("SELECT `nome` FROM `actor` WHERE MONTH(birthday) = MONTH(NOW()) AND DAY(birthday) = DAY(NOW())"); $actor = array(); while ($row = mysql_fetch_assoc($result)) $actor[] = $row['nome']; return $actor; } // make a unordered-list out of the actor having birthday $ul = "<ul>"; foreach(birthday_today() as $nome) $ul .= "<li>$nome</li>"; $ul .= "</ul>"; echo $ul; ?> | Я должен интегрировать это для возраст фото вкладка ссылки Код: <td class="text-center"><?php if($row['foto'] != ""): ?> <img src="image_upload/actor/uploads/<?php echo $row['foto']; ?>" width="110px" height="130px" style="border:1px solid #333333;"> <?php else: ?> <img src="image_upload/actor/images/nophoto170.png" width="100px" height="130px" style="border:1px solid #333333;"> <?php endif; ?></td> <td class="text-left"><?php echo "<a href=\"cinema.php?id=" . $row['actor_id'] . "\">" . $row['nome'] . "</a>";?></td> | Код: <?php // $datanascita = $row['birthday']; $dateOfBirth = $datanascita; $today = date("Y-m-d"); $diff = date_diff(date_create($dateOfBirth), date_create($today)); ?> |
|