-2

I use this function :

function edit_post($id, $title, $content, $img) {
    global $connect;
    $id = (int)$id;
    $title = mysql_real_escape_string($title);
    $content = mysql_real_escape_string(nl2br($content));
    $img = mysql_real_escape_string($img);
    $date_posted = date("Y-m-d H:i:s");

    mysqli_query($connect, "UPDATE `topics` SET
                `title` = '$title',
                `content` = '$content',
                `img` = '$img' WHERE `id` = {$id}");

}

To make an update on database ..

and call it by this :

edit_post($_GET['id'], $title, $content, $img);

but it not make the update i want to

Shifter
  • 9
  • 4

1 Answers1

0

Function is calling or not? Maybe you have to call this function like this:

$this->edit_post($_GET['id'], $title, $content, $img);
Waqas Shahid
  • 1,051
  • 1
  • 7
  • 22