Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 17th, 2003, 01:47 AM
Registered User
 
Join Date: Sep 2003
Location: Singapore, , Singapore.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Parameter passing

Hi,

I am trying to understand the online polls example shown in the book PHP-MySQL Programming page 286. I guess it is related to the issue of parameter passing between a PHP script and a PHP class. There are 2 elements involved:

1 - ../polls/index.php, a script that calls the function getActivePolls($iCursor) from the class.polls.php to populate dynamically an array called $aPoll. The $iCursor variable is derived from a URL query and can take the value 0,1 or 2 via a $_GET["cursor"]. The array is defined as follows:

$aPoll = $oPolls->getActivePolls($iCursor);

2 - ../class.polls.php, an object class that includes, among others, the above function called getActivePolls(), with one argument $iPage, that retrieves a particular poll from a MySQL table, in the following way:

function getActivePolls($iPage=0) {

$sql = "SELECT poll_id,poll_vote_cnt,poll_question
        FROM tab_polls
        WHERE status=1 AND deleted =0
        ORDER BY created_dt DESC
        LIMIT ".$iPage.",1;

//...some more code to check DB error

 }

My Problem:

I cannot get $iPage to vary dynamically in sync with $iCursor, so as to be able to paginate through all three different polls (for $iPage=0,then 1, then 2), as input for $iCursor itself is derived from a pagination form defined in ../polls/index.php.

Thanks in advance for a clue.


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameter sarah lee ASP.NET 1.0 and 1.1 Basics 3 September 5th, 2006 04:29 PM
problem with passing parameter hertendreef ADO.NET 0 June 23rd, 2006 10:00 AM
Passing a Date Parameter ego_mouse BOOK: Professional Crystal Reports for VS.NET 1 January 27th, 2005 08:12 AM
passing parameter.. suzila VB.NET 2002/2003 Basics 7 May 17th, 2004 08:28 PM
Passing Parameter tgopal Javascript 3 August 7th, 2003 07:54 PM



All times are GMT -4. The time now is 07:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.