-3
phpとsqlの新機能です。私はブログを構築しようとしているだけで、localhostを実行しようとするとエラーメッセージが表示されます。私はPHPバージョン7とSQLバージョン5.7を使用しています。 この26行目でエラーが発生しています構文エラー:C: wamp2017 www PHPCMS categories.phpの予期しない 'VALUES'(T_STRING)
私を助けてください。挿入のためのクエリのための多くのおかげで
<?php require_once("Include/db.php"); ?>
<?php require_once("Include/sessions.php"); ?>
<?php require_once("Include/functions.php"); ?>
<?php
if(isset($_POST["Submit"])){
$Category=mysqli_real_escape_string($_POST["Category"]);
date_default_timezone_set("Europe/London");
$CurrentTime=time();
//$DateTime=strftime("%Y-%m-%d %H:%M:%S",$CurrentTime);
$DateTime=strftime("%B-%d-%Y %H:%M:%S",$CurrentTime);
$DateTime;
$Admin="Admin";
if(empty($Category)){
$_SESSION["ErrorMessage"]="All Fields must be filled out";
Redirect_to("categories.php");
}elseif(strlen($Category)>99){
$_SESSION["ErrorMessage"]="Too long Name for category";
Redirect_to("categories.php");
}else{
global $linkDB;
$Query="INSERT INTO category(datetime,name,creatorname)"
VALUES('$DateTime','$Category','$Admin');
$Execute=mysqli_query($Query);
if($Execute){
$_SESSION["SuccessMessage"]="Category Added Successfully";
Redirect_to("categories.php");
}
else{
$_SESSION["ErrorMessage"]="Catrgory failed to Add";
Redirect_to("categories.php");
}
}
}
?>
<!DOCTYPE>
<html>
<head>
<title>Manage Categories</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-3.2.1.min.js"></script>
<script src="bootstrap.min.js"></script>
<link rel="stylesheet" href="css/adminstyles.css">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
<h1>My First Blog</h1>
<ul id="side_Menu" class="nav nav-pills nav-stacked">
<li><a href="admin_dashboard.php">
<span class="glyphicon glyphicon-home"></span> Dashboard</a></li>
<li><a href="#"><span class="glyphicon glyphicon-list-alt"></span> Add New Post</a></li>
<li class="active"><a href="categories.php"><span class=" glyphicon glyphicon-tag "></span> Categories</a></li>
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Manage Admins</a></li>
<li><a href="#"><span class="glyphicon glyphicon-comment"></span> Comments</a></li>
<li><a href="#"><span class="glyphicon glyphicon-equalizer"></span> Live Blog</a></li>
<li><a href="#"><span class="glyphicon glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</div> <!--Ending of Side area-->
<div class="col-sm-10">
<h1>Manage Categories</h1>
<div><?php echo Message();
echo SuccessMessage();
?>
<div>
<form action="categories.php" method="post">
<fieldset>
<div class="form-group">
<label for="categoryname">Name:</label>
<input class="form-control" type="text" name="Category" id="catrgoryname" placeholder="Name">
</div>
<input class="btn btn-success btn-block" type="Submit" name="Submit" value="Add New Category">
</fieldset>
<be>
</form>
</div> <!--ending of main area-->
</div> <!--ending of row-->
<!--end of container -->
<div id="Footer">
<hr><p>Blog by A R Khalid ¦ ©Media Shark</p>
<a style="color: white; text-decoration: none; pointer; font-weight:bold;">
<div style="height: 10px; background:#27AAE1;"></div>
</body>
</html>
構文エラー、あなたが終了二重引用符を忘れてしまったよう'' ' –