Aşağıdaki kodları yazdığımda başlıktaki gibi bir hata alıyorum nasıl çözebilirim ? Bold ile işaretlediğim alanda hata gösteriyor. Yardımcı olabilirseniz müteşekkir olurum.
<div class="post_area"> <?php
if(!isset($_GET ['cat'])) {
$get_posts = "select * from posts order by rand() LIMIT 0,6 "; $run_posts = mysqli_query($con, $get_posts);
while ($row_posts = mysqli_fetch_array($run_posts))
<div>$post_content <a id='rm link' href='single_page.html?post=$post_id'> Read More </a> </div> <br/>
";
}
}
else
if (isset($_GET['cat'] )){
$get_posts="select * from posts where category_id='cat_id'"; $run_posts=mysqli_query($con, $get_posts); while ($row_posts=mysqli_fetch_array($run_posts)) { $post_id=$row_posts['post_id']; $post_title=$row_posts['post_title']; $post_image=$row_posts['post_image']; $post_content=substr($row_posts['post_content'],0,300);
echo "
<h2><a id = 'title' href='details.php?post=?post_id'>@post_title</a></h2>
<div class="post_area">
<?php
if(!isset($_GET ['cat'])) {
$get_posts = "select * from posts order by rand() LIMIT 0,6 ";
$run_posts = mysqli_query($con, $get_posts);
while ($row_posts = mysqli_fetch_array($run_posts))
{
$post_id = $row_posts['post_id'];
$post_title = $row_posts['post_title'];
$post_image = $row_posts['post_image'];
$post_content = substr($row_posts['post_content'],0,300);
echo "
<h2><a id = '1title' href='details.php?post=?post_id'>@post_title</a></h2>
<img src='admin/news_images/'$post_image' width='100' height='100' />
<div>$post_content <a id='rm link' href='single_page.html?post=$post_id'> Read More </a> </div> <br/>
";
}
}
else
if (isset($_GET['cat'] )){
$get_posts="select * from posts where category_id='cat_id'";
$run_posts=mysqli_query($con, $get_posts);
while ($row_posts=mysqli_fetch_array($run_posts))
{ $post_id=$row_posts['post_id'];
$post_title=$row_posts['post_title'];
$post_image=$row_posts['post_image'];
$post_content=substr($row_posts['post_content'],0,300);
echo "
<h2><a id = 'title' href='details.php?post=?post_id'>@post_title</a></h2>
<img src='admin/news_images/'$post_image' width='100' height='100' />
<div>$post_content <a id='rm link' href='details.html?post=$post_id'> Read More </a> </div> <br/>
";
}
}
?>