Current location: Hot Scripts Forums » Programming Languages » PHP » Can Someone Help Me With This Error


Can Someone Help Me With This Error

Reply
  #1 (permalink)  
Old 09-19-05, 11:25 AM
tommyc325's Avatar
tommyc325 tommyc325 is offline
Wannabe Coder
 
Join Date: Sep 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Can Someone Help Me With This Error

im getting a error in one of my pages where im trying to set up one of those page navigation ( Next Last Page 1,2,3,4,5,6,7) so anyways i figured out that it has to do with these 2 lines arguing for some reason.


$query_news = "SELECT id, headline, content, date_format(date, '%c-%d-%y') as 'date_f' FROM news WHERE date <= $today2 ORDER by date DESC LIMIT 10, $spitrecords";
$query_limit_news = sprintf("%s LIMIT %d, %d", $query_news, $startRow_news, $maxRows_news);

the weird thing is if i take out LIMIT 10, $spitrecords in the main query it works fine but it's very important that i keep that line in there.

Any Takers.

Thanks guys

Tom
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-19-05, 12:29 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
you can't have 2 LIMITs in your query!
the first one is in $query_news and the secon one in $query_limit_news! so if you print $query_limit_news you will probably see something like this:
Code:
SELECT id, headline, content, date_format(date, '%c-%d-%y') as 'date_f' FROM news WHERE date <= $today2 ORDER by date DESC LIMIT 10, $spitrecords LIMIT %d, %d
which is wrong.
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-19-05, 01:02 PM
tommyc325's Avatar
tommyc325 tommyc325 is offline
Wannabe Coder
 
Join Date: Sep 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
thanks again nevermind but what would be correct then.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-19-05, 02:59 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
you said it yourself
remove one of the LIMITs and it will work..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 09-19-05, 11:21 PM
tommyc325's Avatar
tommyc325 tommyc325 is offline
Wannabe Coder
 
Join Date: Sep 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Hey nevermind that worked but for some reason every time i go to the next page i`m getting the same records showing up

http://www.alteredimage.com/testsite/newsarchives.php

not sure why though.

Any suggestions.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
xmb to invsion error shaorin PHP 0 07-11-05 03:30 AM
ASP upload prob minority ASP 1 06-27-05 09:35 AM
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown error) padmanaban_bala Perl 2 05-03-05 06:00 PM
parse error... help? kappler0 PHP 2 01-21-04 04:57 AM
[php error] parse error | fatal error xeoHosting PHP 1 01-03-04 09:12 PM


All times are GMT -5. The time now is 06:36 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.