Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $mysqli = mysqli_connect('localhost', 'root', '', 'photo');
- $row = mysqli_query($mysqli,"SELECT * FROM `img` WHERE `albom_id`=1 ");
- if($row){//если запрос выполнен
- while($res = $row->fetch_object()){//перебираем результат в цикле
- echo '
- <img alt="" src="'.$res->url.'" style="max-width: 100%; width: 470px; margin: 6px 0; max-height: auto;" /><br>
- ';
- $ress = $res->id;
- if ($_SESSION["admin"] || isset($_SESSION["admin"])) {
- echo '<input type="button" value="Удалить" >
- <input type="hidden" value="'.$ress.'">';
- }
- }
- }
- else{
- echo 'Ошибка запроса';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement