Commit d21adba1 authored by Srinivas's avatar Srinivas
Browse files

Update successg.php

parent 70b2e0ff
<?php
session_start();
include('connection.php');
$connection = getdb();
?>
<!DOCTYPE html>
<html>
......@@ -143,8 +146,6 @@ window.onload = function(){
<?php
$x=$_GET['id'];
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,'test');
$query= "SELECT * FROM student where ID='$x' ";
$query_run = mysqli_query($connection,$query);
$row = mysqli_fetch_array($query_run);
......@@ -153,17 +154,16 @@ $NAME=$row['Name'];
$HostelName=$row['HostelName'];
$GrevName=$_POST['GrevName'];
$message=$_POST['message'];
$conn = new mysqli('localhost','root','','test');
if($conn->connect_error){
die('Connection Failed : '.$conn->connect_error);
if($connection->connect_error){
die('Connection Failed : '.$connection->connect_error);
}
else{
$stmt = $conn->prepare("insert into grievance(ID,NAME,HostelName,GrievanceType,Reason)
$stmt = $connection->prepare("insert into grievance(ID,NAME,HostelName,GrievanceType,Reason)
values(?,?,?,?,?)");
$stmt->bind_param("sssss",$ID,$NAME,$HostelName,$GrevName,$message);
$stmt->execute();
$stmt->close();
$conn->close();
$connection->close();
}
?>
<div class="main1">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment