View Single Post
Old 2007-12-28, 08:22 PM   #6
spacedog
WHO IS FONZY!?! Don't they teach you anything at school?
 
Join Date: Mar 2007
Posts: 45
Quote:
Originally Posted by walrus View Post
Or, in other words, read the fucking manual
yep. did everything it said.. even installed the role manager, etc..

tried several times & nothing works.. not in a post nor as a page.

I have tgp on root & blog in dir.

Script is in root & trying to include tgp script in post thats on blog in dir as

Code:
<?
 include("../script.php");
 $query   = "SELECT COUNT(url) AS numrows FROM links";
 $result  = mysql_query($query) or die('Error, query failed');
 $row     = mysql_fetch_array($result, MYSQL_ASSOC);
 $numrows = $row['numrows'];
 
 $maxPage = ceil($numrows/65);

 $sql = "SELECT url, title, date FROM `links` ORDER BY date DESC LIMIT ".$offset.", 65;";
 $rs = mysql_query($sql);
 echo mysql_error();
 
 
 $self = $_SERVER['PHP_SELF'];
 $nav = '';
 for($page = 1; $page <= $maxPage; $page++)
 {
    if ($page == $pageNum)
    {
        $nav .= " $page ";
    }
    else
    {
        $nav .= " <a href=\"$self?page=$page\">$page</a> ";
    }
 }

while($row = mysql_fetch_row($rs)){
     echo "<a href=\"".$row[0]."\">".$row[1]."</a>".$row[2]."\n<br>\n";}

 echo "<p>Page: ";
 $self = $_SERVER['PHP_SELF'];
 $nav = '';
 for($page = 1; $page <= $maxPage; $page++)
 {
    if ($page == $pageNum)
    {
        $nav .= " $page ";
    }
    else
    {
        $nav .= " <a href=\"$self?page=$page\">$page</a> ";
    }
 }

echo $first . $prev . $nav . $next . $last;
 mysql_close();
?>
and I end up with on the post
Code:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 65′ at line 1
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /dirname/0/blahblah/htdocs/file/name/wp-content/plugins/exec-php/runtime.php(41) : eval()’d code on line 29
__________________
spacedog is offline   Reply With Quote