Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Error in the pagination

Asked Modified Viewed 3,736 times
Y
yasel
Y
yasel 10
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
asked
Newbie

If I put this value in the URL:

www.php-fusion.co.uk/news.php?rowstart=99999999999999999999999999999999999

Shows me the following error:

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 '99999999999999999999999999999999999,5' at line 8

Page 2.0E+34 of 85: 1...

?rowstart=99999999999999999999999999999999999 error can occur in:
- Downloads
- News
- Articles
- Members
- Comments
........
and anywhere you use pagination


How to fix?
Edited by yasel on 23-01-2012 04:08,
0 replies

2 posts

M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Hackfix: (maincore.php)
function isnum($value)
{
     if (!is_array($value) && strlen($value)<=19)
        return (preg_match("/^[0-9]+$/", $value));
     else
        return false;
}

... I will try to come up with better solution.
0 replies
C
Christian
C
Best regards,
Christian Damsgaard Jørgensen.
  • Member, joined since
  • Contributed 125 posts on the community forums.
  • Started 4 threads in the forums
answered
Member

Thank you for reporting :)

Please see this thread.

The fix:

news.php, line 37:
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }

Replace with:
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart']) || $_GET['rowstart'] > $rows) { $_GET['rowstart'] = 0; }

That should do the trick :)
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Best regards,
Christian Damsgaard Jørgensen.
  • Member, joined since
  • Contributed 125 posts on the community forums.
  • Started 4 threads in the forums
M
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
Y
Y
yasel 10
  • Newbie, joined since
  • Contributed 3 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet