Re: [PHP-DB] Tricky MySQL / php Script

2004-08-18 Thread Peter Ellis
I assume you mean the 1052367746 portion of that URL?  Am I right?  If
so:

$id = basename($photoid, .jpg);

That would work, I think, if you just wanted the numeric portion of the
path.  Not sure if this is what you want.
-- 
Peter Ellis - [EMAIL PROTECTED]
Web Design and Development Consultant
naturalaxis | http://www.naturalaxis.com/

On Wed, 2004-08-18 at 19:55 -0400, Vern wrote:
 I have a bunch of thumbnails that are pulled from a recordset based on a
 user profile.
 Each thumbnail opens the picture into another page so that the picture is
 larger and I want to now have that user's pictures accessible by clicking a
 previous and/or next arrow.
 
 The first recordset of thumbnails is retrieved by a URL link
 ($HTTP_GET_VARS['id']) which is the user's ID number.
 Click on one of the thumbnails a new page is open that display the larger
 photo, but only that photo. I can of course pass along the user's ID as well
 
 mypage.php?photoID=uploads/1052367746.jpguserID=215
 
 which of course will allow me to create a new recordset based on the user's
 id
 
 SELECT *
 FROM penpals_photos
 WHERE penpals_photos.filename = $photoID
 
 but how do I point the database first record at the photoID so that I can
 use the next and previous options to see the next/previous picture?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Tricky MySQL / php Script

2004-08-18 Thread Vern
That's not what I mean at all. I actually have no idea where you got that
from. :)

Basically what I'm trying to say is this. The following is my url:

mypage.php?photoID=uploads/1052367746.jpguserID=215

 photoID =  uploads/1052367746.jpg
 userID   =  215

I want to point to a record in a recordset.
That records id is  uploads/1052367746.jpg
However, I want to return all records for the userID 215.

How do I point my recordset at that file in the recordset so that the user
can go to the next and previous records in that recordset based on the
user's id?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Tricky MySQL / php Script

2004-08-18 Thread Peter Ellis
Ach, and the light bulb goes on.  Sorry, wasn't really thinking about it
completely earlier.

Here's a less dimbrained suggestion: could you encode the user ID as
part of the filename itself?  Like, for instance, write the script so
that it would read something like:

blah.jpg.215

and strip off the .215, converting it into a user ID and stripping it
from the file name before displaying the file?

Hopefully, that's much closer to an actual coherent suggestion :)

- P

On Wed, 2004-08-18 at 21:23 -0400, Vern wrote:
 That's not what I mean at all. I actually have no idea where you got that
 from. :)
 
 Basically what I'm trying to say is this. The following is my url:
 
 mypage.php?photoID=uploads/1052367746.jpguserID=215
 
  photoID =  uploads/1052367746.jpg
  userID   =  215
 
 I want to point to a record in a recordset.
 That records id is  uploads/1052367746.jpg
 However, I want to return all records for the userID 215.
 
 How do I point my recordset at that file in the recordset so that the user
 can go to the next and previous records in that recordset based on the
 user's id?
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Tricky MySQL / php Script

2004-08-18 Thread Vern
Sorry but that doesn't make and sense either. I have no problems passing the
variables along. Why are you trying to tag that to the image?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Tricky MySQL / php Script

2004-08-18 Thread Jason Wong
On Thursday 19 August 2004 09:23, Vern wrote:

 Basically what I'm trying to say is this. The following is my url:

 mypage.php?photoID=uploads/1052367746.jpguserID=215

  photoID =  uploads/1052367746.jpg
  userID   =  215

 I want to point to a record in a recordset.
 That records id is  uploads/1052367746.jpg
 However, I want to return all records for the userID 215.

 How do I point my recordset at that file in the recordset so that the user
 can go to the next and previous records in that recordset based on the
 user's id?

Assuming you have already created your 'recordset':

  loop through recordset looking for 'photoID'
  when found, use mysql_data_seek() to grab the previous and next records

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
No problem is so formidable that you can't walk away from it.
 -- C. Schulz
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php