• 27-07-2010, 14:24:30
    #1
    selam arkadaşlar.

    ben makalenin id'sine göre yorumları veritabanınan çekmek ve while ile loop etmek istiyorum ama şöyle bir hata geliyor:

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pressexpress\viewarticle.php on line 38

    Yorumlar:
    <?php 
    $sorgu = mysql_query("SELECT * FROM yorumlar WHERE a_id='$id'" ); 
    while ($kayit = mysql_fetch_array($sorgu, MYSQL_ASSOC))
    {
    	$name=$kayit["name"];
    	$email=$kayit["email"];
    	$website=$kayit["website"];
    	$comment=$kayit["comment"];
    	$comment_id=$kayit["comment_id"];
    	$date=$kayit["date"];
    ?>
    <table width="60%" border="0">
      <tr>
        <td width="20%"><a href="<?php echo $website; ?>"><?php echo $name; ?></a></td>
        <td width="20%"><?php echo $date; ?></td>
        <td width="20%"><strong><?php echo $comment_id; ?></td>
      </tr>
      <tr>
        <td colspan="3"><?php echo $comment; ?></td>
      </tr>
    </table>
    <?php } ?>
  • 27-07-2010, 14:28:20
    #2
    Sorguda veya mysql bağlantısında bir sorun olabilir.

    $sorgu = mysql_query("SELECT * FROM yorumlar WHERE a_id='$id'" ) or die("Sorgu hatasi: ".mysql_error());
    dener misin ?
  • 27-07-2010, 14:31:00
    #3
    tabii ya. daha önceden tabloda a_id olan değeri article_id olarak değiştirdim, öyle kalmış phpde.

    sorun çözüldü.
  • 31-07-2016, 17:29:22
    #4
    🔥%100 WP Optimizasyon🔥
    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/xxxxx/public_html/tv/index.php on line 59

    bu hatayı alıyorum.Bu konuda bilgisi olan var mı?