-
Notifications
You must be signed in to change notification settings - Fork 0
/
details.php
36 lines (28 loc) · 964 Bytes
/
details.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
include 'connection.php';
if (isset($_POST['bycategory'])) {
// $name=$_POST['name'];
// $phone=$_POST['phone'];
// $email=$_POST['email'];
// $subject=$_POST['subject'];
// $message=$_POST['message'];
$query = " SELECT * FROM `hostel` WHERE hostel_id=1";
$result = mysqli_query($conn, $query);
// Find the number of records returned
$num = mysqli_num_rows($result);
echo $num;
echo " records found in the DataBase<br>";
if($num> 0){
while($row = mysqli_fetch_assoc($result)){
// echo var_dump($row);
echo $row['sno'] . ". Hello ". $row['name'] ." Welcome to ". $row['dest'];
echo "<br>";
}
}
$run = mysqli_query($conn, $query) or die(mysqli_error());
if ($run)
echo "Message sent successfully!!!!";
else
echo "Message not sent!!!!!";
}
?>