MySQL Forums
Forum List  »  Russian

Вывести на экран данные из таблицы через РНР
Posted by: Vlad Vladoff
Date: June 25, 2014 10:38AM

Помогите, не пойму где ошибка:


$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"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

echo "</table><br/>";


Ничего не выводит на экран, кроме шапки таблицы.

Options: ReplyQuote

Written By
Вывести на экран данные из таблицы через РНР
June 25, 2014 10:38AM

Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.

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.