What's new

Help 911 programmer gadz patulong.

M1cro egi-

Elite
Joined
Mar 6, 2020
Posts
1,619
Solutions
2
Reaction
3,119
anong mali dito, kasi pag 1-10 nadedelete pero pag nagsearch ka or nasa page2 ka hindi nadedelete pa help naman po.

Code:
function delete_branch(){
        extract($_POST);
        $delete = $this->db->query("DELETE FROM branches where id = $id");
        if($delete){
            return 1;
        }
    }
 

Attachments

m1k3y

Journeyman
ano ung ginagawa ng extract function?, and need mo siguro i check yung value ng $id para malaman mo kung tama ba ung value everytime na i call ung query.
 

Kshsjdydi1

Established
yon nga nid ko sana pati yong 2nd page working yong delete goods naman sa edit paps
wag mo na gamitin ung datables gawa ka sariling pagination lods, yan din kasi prob ko sa system ko dati nakaka pag crud ako sa first page, pero sa second page walana, prenisent ko nalng ng ganon hahah

codeigiter gamit mo dba, may buildin pagination ata jn, un nalng gamitin mo
 

geneodan

Grasshopper
try mo
function delete_branch($id){
$delete = $this->db->query("DELETE FROM branches where id = $id");
if($delete){
return 1;
}
}

Then sa delete button gawin mong <a href="<?=base_url("controllerName/delete_branch/{$id}")?>">Delete
</a>
 
Top