<?php
require_once './includes/config.php';
$con = new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
$sql = "SELECT * FROM contact-info";
if($result = $con->query($sql)){
while($row = $result->fetch_object()){
//display record 1 by 1
printf('
<tr>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>
',$row->id,
$row->name,
$row->email,
$row->phone,
$row->comment);
}
}
printf('
<tr>
<td colspan="5">
%d record(s) returned.
[ <a href="insert-student.php">Insert Student</a> ]
</td>
</tr>
',$result->num_rows);
$con->close();
?>
Hayic 0 Newbie Poster
rproffitt 2,693 https://5calls.org Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.