Greenguy's Board


Go Back   Greenguy's Board > Blogs and Blogging
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:53 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc