![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 11 Pomógł: 0 Dołączył: 9.11.2004 Skąd: Jaworzno Ostrzeżenie: (0%) ![]() ![]() |
Witam mam taki oto problemik mam funkcję ( jedną z kilku w każdej mam ten sam problemik) :
Kod function removeCalendar($id ){ $ret = array(); try{ $db = new DBConnection(); $db->getConnection(); $sql = "delete from Kalendarz_1 where `id`=" . $id; if(mysql_query($sql)==false){ $ret['IsSuccess'] = false; $ret['Msg'] = mysql_error(); }else{ $ret['IsSuccess'] = true; $ret['Msg'] = 'Succefully'; } }catch(Exception $e){ $ret['IsSuccess'] = false; $ret['Msg'] = $e->getMessage(); } return $ret; } Która dokonuje usunięcia z bazy i wszystko gula pod warunkiem że nazwa tabeli jest zapisana bezpośrednio czyli Kalendarz_1 ja niestety potrzebuje wstawiać nazwę tabeli dynamicznie w zależności od zalogowanego do systemu user i jak bym nie kobinował nie umiem sobie z tym poradzić np robie tak : Kod $jakasnazwatabeli = 'Kalendarz_11'; function removeCalendar($id ){ $ret = array(); try{ $db = new DBConnection(); $db->getConnection(); $sql = "delete from $jakasnazwatabeli where `id`=" . $id; if(mysql_query($sql)==false){ $ret['IsSuccess'] = false; $ret['Msg'] = mysql_error(); }else{ $ret['IsSuccess'] = true; $ret['Msg'] = 'Succefully'; } }catch(Exception $e){ $ret['IsSuccess'] = false; $ret['Msg'] = $e->getMessage(); } return $ret; } i nie che mi to działać proszę o pomoc (IMG:style_emoticons/default/smile.gif) Z góry dziękuje |
|
|
![]() ![]() |
![]() |
Aktualny czas: 16.09.2025 - 19:36 |