Jump to content

mysql_fetch_array(): supplied argument is not a valid MySQL


radian

Recommended Posts

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\WebServer\www\tests\index.php

 

getting this error with

<?php
mysql_connect("localhost", "root", "");
mysql_select_db("news");
$return = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0, 10');
while ($data = mysql_fetch_array($return))
{
?>
<div class="news">
    <h3>
        <?php echo $data['title']; ?>
        <em> - <?php echo date('m/d/Y H\hi', $data['timestamp']); ?></em>
    </h3>
    
    <p>
    <?php
    $content = nl2br(stripslashes($data['content']));
    echo $content;
    ?>
    </p>
</div>
<?php
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.