-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path48.php
More file actions
29 lines (25 loc) · 646 Bytes
/
48.php
File metadata and controls
29 lines (25 loc) · 646 Bytes
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
<?php
$db_host="localhost";
$db_user="root"
$db_password="";
$db_name="test_db";
$con=mysqli_connect($db_host,$db_user,$db_password,$db_name);
if (!$con)
{
die("Connection Failed".mysqli_connect_error());
}
echo "Connected";
$sql="SELECT *FROM student";
$result=mysqli_prepare($con,$sql);
mysqli_stmt_bind_result($result,$id,$name,$roll,$address);
mysqli_stmt_execute($result);
mysqli_stmt_fetch($result);
mysqli_stmt_store_result($result);
if (mysqli_stmt_num_rows($result)>0)
{
foreach ($print=mysqli_stmt_store_result($result) as $row)
{
echo "ID:".$row['id']."NAME:".$row['name']."ROLL:".$row['roll']."ADDRESS:".$row['address'];
}
}
?>