Arama butonu
Bu konudaki kullanıcılar: 1 misafir
3
Cevap
3146
Tıklama
0
Öne Çıkarma
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given
A
10 yıl (219 mesaj)
Teğmen
Konu Sahibi

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))

{

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

";



}

}
?>



A
10 yıl (219 mesaj)
Teğmen
Konu Sahibi

Yok mu bir babayiğit yardım edebilicek :(


Bu mesaja 1 cevap geldi.
N
10 yıl (7922 mesaj)
Yarbay

Sorgulama kısmında hata var aslında.

$get_posts = "select * from posts order by rand() LIMIT 0,6 ";

Şu kısmı

select * from posts order by rand() LIMIT 0,6

phpmyadmin'de sorgulatınca sonuç çıkıyor mu?




Bu mesajda bahsedilenler: @akilyolu.
A
10 yıl (219 mesaj)
Teğmen
Konu Sahibi

Çözdüm tesekkurler yine de. Veritabanında eksik tablo girilmiş ondan veriyor hatayi.



< Bu ileti mobil sürüm kullanılarak atıldı >

DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.