I have a MySQLi statement in a function as follows:
and then a while loop to iterate over all the results:
It causes the table to just grow infinitely large without actually populating what it should. Having the statements outside the function works fine, however.
PHP Code
<?php
function getTimeData($time) {
$con = mysqli_connect("cptdb-enc.cvsafxbefwwm.eu-west-2.rds.amazonaws.com:3306", "root", "j7I4XaA6UnX1", "Iron") or die (mysql_error());
$selectedDate = $_SESSION['date'];
$prepTimeData = mysqli_prepare($con, "SELECT * FROM `time` WHERE `date`=? AND `time`<=? AND `endTime`>=?");
$prepTimeData->bind_param("sss", $selectedDate, $time, $time);
$prepTimeData->execute();
$getTimeData = $prepTimeData->get_result();
return $getTimeData;
}
and then a while loop to iterate over all the results:
PHP Code
<?php
while ($data0800 = getTimeData("0800")->fetch_assoc()) {
?><tr><td><?php $data0800['first_name'];?></td>
<td><?php $data0800['riderage'];?></td>
<td><?php $data0800['ridinglevel'];?></td>
<td><?php $data0800['horse'];?></tr><?php
}
It causes the table to just grow infinitely large without actually populating what it should. Having the statements outside the function works fine, however.
aint my sig design skills sick?

