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;
}
$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;
}
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

Z góry dziękuje