Mobile app version of vmapp.org
Login or Join
Miguel251

: PHP database information in a table that can be displayed on a website Hey guys i just want to put the information from the database into a table which i can display on a website but i

@Miguel251

Posted in: #Html #Html5 #Php #Phpmyadmin

Hey guys i just want to put the information from the database into a table which i can display on a website but i have no idea how to do it.

<?php
include 'database_conn.php'; // make db connection

$sql = "SELECT eventID, eventTitle, eventDescription, venueID, catID, eventStartDate, eventEndDate, eventPrice FROM AE_events ORDER BY eventTitle";
$queryResult = $dbConn->query($sql);
if($queryResult === false) {
echo "<p>Query failed: ".$dbConn->error."</p>n</sample1>n</html>";
exit;
}

else {
while($rowObj = $queryResult->fetch_object()){
$eventid = $rowObj->eventID;
$eventT = $rowObj->eventTitle;
$eventDe = $rowObj->eventDescription;
$venueid = $rowObj->venueID;
$catid = $rowObj->catID;
$eventStart = $rowObj->eventStartDate;
$eventEnd = $rowObj->eventEndDate;
$eventPr = $rowObj->eventPrice;


echo "<div class= event>
<span class= title>$eventT</span>
<span class= description>$eventDe</span>
<span class= start_date>$eventStart</span>
<span class= end_date>$eventEnd</span>
£ <span class= price>$eventPr</span>
</div>";
}
}
$queryResult->close();
$dbConn->close();
?>

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme