Current location: Hot Scripts Forums » Programming Languages » PHP » next prev buttons with exclude (see code and decription)


next prev buttons with exclude (see code and decription)

Reply
  #1 (permalink)  
Old 12-04-06, 08:42 PM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
next prev buttons with exclude (see code and decription)

What I am trying to finish up here, and coming close is; I have a script that calls the data from the table. No problems there. Images called in and everything, no problems there. What I would like to be able to do is have a next and previous button for the user to hit. the next button can trigger the random button that is fine, but not bring up the same group that was already displayed. the previous needs to go back to the previous.

Here is the database code working great

PHP Code:

<?php
//variables
 
children(); 
 
$images_dir ='images/childsImages/';
 
$path $images_dir $childrenInfo['childsImages'] ;
?>
<?php
//calling of the childrens information into place
function children (){
 
$children ="";
 
$query "SELECT * FROM sponsor ORDER BY RAND() LIMIT 1";
 
$result mysql_query($query);
while (
$childrenInfo mysql_fetch_array($result))
{
foo foo this is just laying out the info
 
<?php
//Closing the calling of the childrens information into place
}
 return 
$children;
}
?>
So if someone could please help me in adding the script for the next, prev, and exclude the new set for the random next. I will be done with this section. Please let me know if you do not understand what I am trying to do.
__________________
learning like everyone else
Reply With Quote
  #2 (permalink)  
Old 12-06-06, 10:02 AM
Shaffer Shaffer is offline
Wannabe Coder
 
Join Date: Sep 2006
Location: Israel
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Hello,
First-off, what are you trying to do?
Second, you have some mistakes...
1. Why would you make those 3 seperate codes?
As you can see you have forgotten to close the second one, never the less did you just add a random "foo foo this is..." that php does not know how to read. To fix that just close that piece of unidentified code in echo ""; or print ""; turning it into a string.
From here I can't really help you since I don't you know what you are trying to do.

Shaffer.
__________________
Hello from Israel!
Reply With Quote
  #3 (permalink)  
Old 12-07-06, 09:21 AM
pkcidstudio's Avatar
pkcidstudio pkcidstudio is offline
Coding Addict
 
Join Date: Nov 2005
Posts: 332
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Shaffer
Hello,
Quote:
Originally Posted by Shaffer

First-off, what are you trying to do? Create a next and previous button; while excluding id's that have already been selected. (Completed already)

Second, you have some mistakes...

1. Why would you make those 3 separate codes? Thought for you (the code is spaced throughout the entire page, html surounds it.)

As you can see you have forgotten to close the second one, never the less (was working to fast forgot to grab it) did you just add a random "foo foo this is... (That is simply saying there is a body of txt here, with certain little call to's scattered about, amongst html)" that php does not know how to read. To fix that just close that piece of unidentified code in echo ""; or print ""; turning it into a string.

From here I can't really help you since I don't you know what you are trying to do.

(Thank you for your suggestions, issue has been solved already)

Shaffer.


See my comments in bold-

Thank you for your help though.

__________________
learning like everyone else
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


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