This question already has an answer here:
I load data from mysql database and display it into listview jqm. Here is my code:
<?php
include "connect.php";
$result = mysqli_query($con,"SELECT * FROM story");
id==$row['id'];
echo "<ul data-role='listview' data-inline='true'>";
while($row = mysqli_fetch_array($result)) {
echo "<li>" ;
echo "<a href='view.php?id=".$rows['id']."' data-rel='external'>";
echo $row['name'];
echo "</a>";
echo "</li>";
}
echo "</ul>";
?>
and view page :
<?php
include "connect.php";
$id = $_GET['id'];
$result = mysqli_query($con,"SELECT * FROM story WHERE id='".$id."'");
$row = mysqli_fetch_array($result);
echo $row['content'];
?>
But it not working and this error: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\1\view.php on line 11. What should I do ?
</div>