![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 16 Pomógł: 0 Dołączył: 22.11.2012 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
mam mały problem a mianowicie nie wiem jak w poniższym zapytaniu zrobić tak że jeśli Select nic nie zwróci funkcja zwróci 0 a jeśli select coś zwróci to funkcja zwróci tablice $allGalleryRowObject ?. Aktualnie jeśli Select nic nie zwróci mam komunikat Call to a member function fetch() on a non-object in.... Kod function getGalleryId($id) {
$connect = parent::getConnection(); $allGallery = $connect -> query('SELECT * FROM galeria_grupy WHERE id = '.$id.''); $allGalleryRowObject = $allGallery->fetch(PDO::FETCH_ASSOC); if (isset($allGalleryRowObject['id'])) { return $allGalleryRowObject; } else { return 0; } } Ten post edytował lukas69 11.02.2013, 13:33:39 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 17.09.2025 - 20:54 |