Getting error on my code can any one tell me what I am doing wrong and how to solve it or any one suggest me the more simple code after select query because I don't want to mess my code and it is not helping
Here is my Code
if(isset($_GET['ID'])){
$page_id = $_GET['ID'];
$page_id = mysqli_real_escape_string($con, $page_id);
$select_query = ("select ID, Title, image, Cost, Vid, content from mobs where ID=?");
$stmt = $con->stmt_init();
if(!$stmt->prepare($select_query))
{
print "Failed to prepare statement\n";
}
else
{
$stmt->bind_param("s", $page_id);
{
$stmt->execute();
$result = $stmt->get_result();
if($result === FALSE) {
die(mysql_error());
}
while($row->mysqli_fetch_array($result))
{
$post_id = $row['ID'];
$post_title = $row['Title'];
$post_image = $row['image'];
$post_cost = $row['Cost'];
$post_vid = $row['Vid'];
$post_cont= $row['content'];
}
I am getting these errors
Notice: Undefined variable: row in
Fatal error: Call to a member function mysqli_fetch_array() on a non-object