Jump to content


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


(Simple) SQL Error

Recommended Posts

[code]$sql = mysql_query("SELECT * FROM Links ORDER BY id asc WHERE ok='1' LIMIT $from, $max_results");
$offset = ($page-1)*$max_results;
$start = 1;

while($row = mysql_fetch_array($sql)){
//    $n = $i++ +1;        //add 1 so that numbers don't start with 0
    $n = $offset + $start;
    echo "<tr>\n";
        echo "<td>$n.</td>\n";
        echo "<td><a href='govisit.php?id=".$row["id"]."' target='_blank'>".$row["linkname"]."</a></td>\n";
        echo "<br><td>".$row["description"]."</td>\n";
        echo "<td><b><a href=\"$url\" target=\"_blank\">".$row["linkname"]."</a> has received ".$row["hits"]." hits from the RDKL LinkBase</b></td>
        echo "<tr><td colspan='4'><hr></td></tr>\n";

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/site/links/rdk.links2.php on line 134

Is my error, any help is appreciated

Share this post

Link to post
Share on other sites
$sql = mysql_query("SELECT * FROM Links WHERE ok='1' ORDER BY id asc LIMIT $from, $max_results") or die(mysql_error());

Share this post

Link to post
Share on other sites


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.