Вывести на экран данные из таблицы через РНР
Помогите, не пойму где ошибка:
<?php
ini_set('display_errors','On');
error_reporting(E_ALL|E_STRICT);
$con=mysqli_connect('localhost', 'root', '', 'task_db');
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT `description`, current_date, `start_time`\n"
. "FROM tasks\n"
. "WHERE `code` LIKE \'daily\'\n"
. "AND `start_time` > current_time\n"
. "AND `exp_day` >= current_date\n"
. "ORDER BY `start_time` ");
echo"<br></br>";
echo"Tasks in HETG";
echo "<table high=50 width=200 border=1 cellspacing=1 cellpadding=10><tr>";
echo "<td>HETG Task</td>";
echo "<td>Date</td>";
echo "<td>Time</td>";
echo $result;
if ($result = mysqli_use_result($con)) {
while($row = mysqli_fetch_row($result))
{
var_dump ($row);
echo "Test # 6"; // False
echo "<tr>";
echo "<td>".$row['description']."</td>";
echo "<td>".$row['current_date']."</td>";
echo "<td>".$row['start_time']."</td>";
echo "</tr>";
echo "Test # 7"; // False
}
$result->close();
}
echo "</table><br/>";
mysqli_close($con);
?>
Ничего не выводит на экран, кроме шапки таблицы.
Subject
Views
Written By
Posted
Вывести на экран данные из таблицы через РНР
4750
June 25, 2014 10:38AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.