I have an info
database table with various things that will go on my pages, I have the editor scripts done, but when it comes to getting the info from the table to place on the pages I am querying the DB for them one by one for each section. How can I query the DB and get all of them (about 10 at present) and be able to read just the content for the section I need, without cycling through each row.
$fetch = db_query($mysqli, "SELECT * FROM `info` WHERE `section` = 'openingtimes'");
$result = $fetch->fetch_assoc();
$openingtimes = $result['content'];
$openingtimes = str_replace("\r\n", "
<br>
", $openingtimes);
$fetch = db_query($mysqli, "SELECT * FROM `info` WHERE `section` = 'foodtimes'");
$result = $fetch->fetch_assoc();
$foodtimes = $result['content'];
$foodtimes = str_replace("\r\n", "
<br>
", $foodtimes);
?>
<?php
echo($openingtimes); ?><br><br><?php
echo($foodtimes);?><br><br>