dimanche 10 mai 2015

getting ajax to load my database without reloading the page

how code i get this code this to work with ajax, i want it to load in an ajax page without having the reload the page

$conn = new mysqli($host, $username, $password, $db_name)or die("cannot connect");

/* show tables */
$sql = "SELECT * FROM Seminars";
$result = $conn->query($sql);

echo '<table border="2" align="center"><th>ID</th><th>Location</th><th>Time</th><th>Title of Lecture</th><th>Speakers Name</th><th>Room Number</th><th>Description</th>';
// output data of each ro
while($row = $result->fetch_assoc()) 
{
   echo '<tr><td>'.$row["idSeminars"].'</td><td>'.$row["Location"].'</td><td>'.$row["Time"].'</td><td>'.$row["TitleOfLecture"].'</td><td>'.$row["SpeakersName"].'</td><td>'.$row["RoomNumber"].'</td><td>'.$row["Description"].'</td></tr>';
}
echo '</table>';

$conn->close();

?>




Aucun commentaire:

Enregistrer un commentaire