edit_exp_db.php
Go to the documentation of this file.
<?php
include('server.php');
if(!$_SESSION['loggedin']) {
header("location: index.php");
}
$a = $_GET['posts_id'];
if(isset($_POST['update'])) {
$name = mysqli_real_escape_string($db, $_POST['name']);
$roll = mysqli_real_escape_string($db, $_POST['roll']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$coursetaken = mysqli_real_escape_string($db, $_POST['coursetaken']);
$company = mysqli_real_escape_string($db, $_POST['companyname']);
$story = mysqli_real_escape_string($db, $_POST['story']);
$student_id = mysqli_real_escape_string($db, $_POST['student_id']);
$roundprovided = implode(",", $_POST['roundprovided']);
$roundcleared = implode(",", $_POST['roundcleared']);
$story = str_replace(array("\n","\n","\\n","\\n"),"<br/>",$story);
$created = date('Y-m-d H:i:s');
$sql = "UPDATE posts SET name = '$name',roll = '$roll' , email = '$email', coursetaken = '$coursetaken',companyname='$company',story='$story',roundprovided='$roundprovided',roundcleared='$roundcleared',created_at='$created' WHERE id=$a";
$result = mysqli_query($db, $sql);
header("location: profile.php");
}
?>