index.php
/**
 * Perform the edit action.
 *
 * @param $sql_conn \mysqli The mysqli connection
 */
Perform the edit action.
@param $sql_conn \mysqli The mysqli connection
Perform the edit action . @param $sql_conn \ mysqli The mysqli connection
function act_edit($sql_conn)
{
    $pid = $_POST["pid"];
    $content = $_POST["content"];
    $result = $sql_conn->query("UPDATE `problem` SET `content` = '" . $sql_conn->real_escape_string($content) . "' WHERE `pid` = $pid;");
    if (!$result) {
        die("edit failed: update content");
    }
}
function act_edit ( $ sql_conn ) { $ pid = $ _POST [ " pid " ] ; $ content = $ _POST [ " content " ] ; $ result = $ sql_conn -> query ( " UPDATE `problem` SET `content` = ' " . $ sql_conn -> real_escape_string ( $ content ) . " ' WHERE `pid` =  $ pid ; " ) ; if ( ! $ result ) { die ( " edit failed: update content " ) ; } }
Perform the edit action.
Perform the edit action .
// Get action parameters // Update problem content