• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to delete multiple table using codeigniter

#1
[eluser]Crackarjack[/eluser]
Code:
function delete_page($page_id)
{
  return $this->db->query("
    DELETE t1, t2
    FROM tech_static_pages t1 JOIN tech_navigation t2
    ON t1.id = t2.page_id
    WHERE t1.id = '".$page_id."'");
}

enjoy.. .

#2
[eluser]rwestergren[/eluser]
You're using double quotes, so no need to concatenate the string:

Code:
function delete_page($page_id)
{
  return $this->db->query("
    DELETE t1, t2
    FROM tech_static_pages t1 JOIN tech_navigation t2
    ON t1.id = t2.page_id
    WHERE t1.id = $page_id");
}

#3
[eluser]Crackarjack[/eluser]
oops its working.. Smile cheers


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.