Leaderboard


Popular Content

Showing content with the highest reputation since 11/10/2019 in all areas

  1. 1 point
    When i create post , i am getting a error. QUERY FAILED .You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Title','NATH',now(),'post tags','post meta titles', 'post meta desc','meta keywo' at line 1 Please help...... <?php if(isset($_POST['create_post'])) { $post_title = escape($_POST['title']); $post_user = escape($_POST['post_user']); $post_tags = escape($_POST['post_tags']); $post_meta_title = $_POST['post_meta_title']; $post_meta_desc = $_POST['post_meta_desc']; $post_meta_keyword = $_POST['post_meta_keyword']; $post_date = escape(date('d-m-y')); $query = "INSERT INTO tests(post_title, post_user, post_date, post_tags,post_meta_title, post_meta_desc, post_meta_keyword) "; $query .= "VALUES({$post_title}','{$post_user}',now(),'{$post_tags}','{$post_meta_title}', '{$post_meta_desc}','{$post_meta_keyword}') "; $create_post_query = mysqli_query($connection, $query); confirmQuery($create_post_query); $the_post_id = mysqli_insert_id($connection); echo "<p class='bg-success'>Post Created. <a href='../post.php?p_id={$the_post_id}'>View Post </a> or <a href='posts.php'>Edit More Posts</a></p>"; } ?> <!-- BEGIN PROFILE CONTENT --> <div class="profile-content"> <div class="row"> <div class="col-md-12"> <div class="portlet light bordered"> <div class="portlet-title tabbable-line"> <div class="caption caption-md"> <i class="icon-globe theme-font hide"></i> <span class="caption-subject font-blue-madison bold uppercase">Profile Account</span> </div> </div> <div class="portlet-body"> <div class="tab-content"> <!-- PERSONAL INFO TAB --> <div class="tab-pane active" id="tab_1_1"> <form class="form-horizontal" action="" method="post" enctype="multipart/form-data"> <div class="form-group"> <label for="title">Post Title</label> <input type="text" class="form-control" name="title"> </div> <div class="form-group"> <label>Users</label> <select class="form-control" name="post_user" id=""> <?php $users_query = "SELECT * FROM users"; $select_users = mysqli_query($connection,$users_query); confirmQuery($select_users); while($row = mysqli_fetch_assoc($select_users)) { $user_id = $row['user_id']; $username = $row['username']; echo "<option value='{$username}'>{$username}</option>"; } ?> </select> </div> <div class="form-group"> <label for="post_tags">Post Tags</label> <input type="text" class="form-control" name="post_tags"> </div> <div class="form-group"> <label for="post_meta_title">Meta Title* </label> <input type="text" class="form-control" name="post_meta_title"> </div> <div class="form-group"> <label for="post_meta_desc">Meta Desc* </label> <input type="text" class="form-control" name="post_meta_desc"> </div> <div class="form-group"> <label for="post_meta_keyword">Meta Keyword* </label> <input type="text" class="form-control" name="post_meta_keyword"> </div> <div class="form-group"> <input class="btn btn-primary" type="submit" name="create_post" value="Publish Post"> </div> </form>
This leaderboard is set to Oslo/GMT+01:00