Jump to content


Photo

(Simple) SQL Error


  • Please log in to reply
1 reply to this topic

#1 RDKL PerFecT

RDKL PerFecT
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 17 May 2006 - 01:51 PM

$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;
    $start++;
    
    //RESULTS
    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>
        </tr>\n";
        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

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 17 May 2006 - 02:06 PM

$sql = mysql_query("SELECT * FROM Links WHERE ok='1' ORDER BY id asc LIMIT $from, $max_results") or die(mysql_error());





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users