本文整理匯總了PHP中comments::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP comments::create方法的具體用法?PHP comments::create怎麽用?PHP comments::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類comments
的用法示例。
在下文中一共展示了comments::create方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: date
$c->c_o_ID = $_GET['id'];
$c->c_authorID = $_SESSION['u_id'];
$c->c_text = $_POST["text"];
$c->c_type = 0;
$c->c_time = date('Y-m-d H:i:s');
$c->create();
redirect_to("forums2.php");
}
if (isset($_POST['submit1'])) {
$c = new comments();
$c->c_o_ID = $_GET['id'];
$c->c_authorID = $_SESSION['u_id'];
$c->c_text = $_POST["text"];
$c->c_type = 1;
$c->c_time = date('Y-m-d H:i:s');
$c->create();
redirect_to("forums2.php");
}
$sql = "SELECT * FROM comment ORDER BY c_id desc limit 1";
$result_set = $database->execute_query($sql);
$row = $database->fetch_array($result_set);
$c_id = array_shift($row);
?>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Debate Club</title>