コード例 #1
0
ファイル: index.php プロジェクト: vihoangson/Program_lesson
    $user_id = $_POST["id_txt"];
    if ($user_id) {
        $sql = 'UPDATE user SET
		user_name	= "' . $user_name . '",
		user_email	= "' . $user_email . '",
		user_age	= "' . $user_age . '",
		user_sex	= "' . $user_sex . '",
		user_phone	= "' . $user_phone . '",
		user_note	= "' . $user_note . '",
		user_finger	= "' . $user_finger . '"
		WHERE user_id=' . $user_id;
    } else {
        $sql = 'INSERT INTO user("user_id","user_name","user_email","user_age","user_sex","user_phone","user_note","user_finger") VALUES
		(null,"' . $user_name . '","' . $user_email . '","' . $user_age . '","' . $user_sex . '","' . $user_phone . '","' . $user_note . '","' . $user_finger . '");';
    }
    if (!$sqlite->exec($sql)) {
        $error = true;
    } else {
        $error = false;
    }
    if (intval($_POST["ajax"]) == 1) {
        if ($error) {
            echo 0;
        } else {
            echo $lesson2->show_result();
        }
        exit;
    }
}
?>
<!DOCTYPE html>