Search
Left Quote    I find that the harder I work, the more luck I seem to have.
- Thomas Jefferson    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: Pagination Tutorial
  This user is online  Guest
  Subject: "Pagination Tutorial" Posted: @ 7:22 pm on Jun 10 2005   
Unregistered
I get an error when i change my information.
Parse error: syntax error, unexpected T_IF in ...page.php on line 39

Line 39 is this:

Code:

while($code = mysql_fetch_obj ect($q)) {
echo("item : ".results- >title." ;<BR>&quo t;
}



    Viewed: 20,806 Times | Reply to This | To top
  This user is offline  UnknownZ
  Subject: "re: Pagination Tutorial" Posted: @ 8:11 pm on Jun 10 2005    
Member #: 47
Rank: User - (29)
Since: 06/02/05
Posts: 29

make sure, you change "title&q uot; to what is in your table column, for example if your table column does not have "title&q uot;, of course it could not layout the table..just replace it..and also replace "results- >" to "code-> ;"

Example:
You have table column, news..
you change it to: code->news
Hope this helps you..




    Viewed: 20,797 Times | Reply to This | To top
  This user is offline  misterhaan
  Subject: "re: Pagination Tutorial" Posted: @ 8:26 pm on Jun 10 2005    

Member #: 5
Rank: User - (213)
Since: 02/11/05
Posts: 148
From: chair

are you sure that's line 39? i see no T_IF there . . . but i do see results->tit le where it probably should be $code->title




please note that the above post is likely made up in its entirety.

    Viewed: 20,793 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Pagination Tutorial" Posted: @ 9:59 pm on Jun 10 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

 bs0d from pagination tutorial said...

< i>The code above will display each row matching the query we previously set. In the echo statement, you see result->titl e -This would display the title of the item in your table if you had a column named title. This is only an example, im sure the code you have to display each individual item is much larger and prettier, I just made it simple for you to see whats going on within the loop.

I swear, if people only read the tutorials... i'll probably just change it and call it a night




-bs0d | AllSyntax.com

    Viewed: 20,787 Times | Reply to This | To top
  This user is offline  UnknownZ
  Subject: "re: Pagination Tutorial" Posted: @ 10:49 pm on Jun 10 2005    
Member #: 47
Rank: User - (29)
Since: 06/02/05
Posts: 29

LoL, by the way, that is a great tutorial, bs0d...
Almost all the tutorial instructions in this website are so simple (in terms of easy to understand ). I really like your tutorials. Thank you.




    Viewed: 20,784 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Pagination Tutorial" Posted: @ 12:25 am on Jun 10 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

Thanks UnknownZ, normally the only feedback are negative or criticize something. I never say this is the best way to do it, but will get the job done! I promise to make more, i've been really busy aside from the website stuff but I plan to set down and get things done here too.

Thanks also for sticking around and waking up the forums! Nice to know some people make good use of them. BTW, how did you find the site anyhow?




-bs0d | AllSyntax.com

    Viewed: 20,780 Times | Reply to This | To top
  This user is offline  UnknownZ
  Subject: "re: Pagination Tutorial" Posted: @ 4:14 am on Jun 11 2005    
Member #: 47
Rank: User - (29)
Since: 06/02/05
Posts: 29

from google.com ...
I was searching for Users Online tutorial..I think I used these keywords: "user online php tutorial"




    Viewed: 20,774 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Pagination Tutorial" Posted: @ 4:26 am on Jun 11 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

ah! cool- did that work out for you (users online)?




-bs0d | AllSyntax.com

    Viewed: 20,768 Times | Reply to This | To top
  This user is offline  UnknownZ
  Subject: "re: Pagination Tutorial" Posted: @ 10:30 am on Jun 11 2005    
Member #: 47
Rank: User - (29)
Since: 06/02/05
Posts: 29

Your script is working fine, I have tested it, but it's not really what I wanted..searchi ng over the net, and finally, I just ripped off from a CMS script + IP2Country script and then modified it to my suit..
because what I wanted was to be able to show Users Online, Members Online, Staff Online, and Who Are Online Now + Where They Are..and they actually need cookies to be implemented in order to work..that's why I posted a question about cookies some days ago..

Thanks for asking..




    Viewed: 20,765 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Pagination Tutorial" Posted: @ 12:29 pm on Jun 11 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

ah, i've done that... from the main page- where you see the number of users online, click on the number itself




-bs0d | AllSyntax.com

    Viewed: 20,762 Times | Reply to This | To top
  This user is offline  UnknownZ
  Subject: "re: Pagination Tutorial" Posted: @ 12:49 pm on Jun 11 2005    
Member #: 47
Rank: User - (29)
Since: 06/02/05
Posts: 29

Yeah, I know..
It would be nice if you could share how you did that..




    Viewed: 20,758 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: Pagination Tutorial" Posted: @ 5:43 pm on Jun 11 2005    

Member #: 1
Rank: Admin. - (1,505)
Since: 02/06/05
Posts: 600
From: USA

easy, im pretty much displaying the exact users_online table i have in the database (except ip's). When they visit, or each time a page load is made record everything about them you can like:

Code:


$ip = $_SERVER['REMO TE_ADDR'];
$time = time();
$useragent = $_SERVER['HTTP _USER_AGENT'];
$request = $_SERVER['REQU EST_URI'];


insert that into their own respective columns in the database. Delete all rows (visitors) where last insertion time ($time) > 5 min (assume they left). If they're already in the table, just update their info.

this is just stuff added to your existing users online script. It must be in a part of code that appears on every page of your site (like page_header). Not difficult at all



Edited at 05:52:22 pm on 06/11/05


-bs0d | AllSyntax.com

    Viewed: 20,754 Times | Reply to This | To top
  This user is offline  UnknownZ
  Subject: "re: Pagination Tutorial" Posted: @ 6:32 pm on Jun 11 2005    
Member #: 47
Rank: User - (29)
Since: 06/02/05
Posts: 29

LoL..
thanks..




    Viewed: 20,748 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

This Topic is Locked






"AllSyntax.com" Copyright © 2002-2018; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank