[thelist] php (if/else)

john corry john at neoncowboy.com
Wed Jun 20 01:09:40 CDT 2001


nevermind...that was a dumb oversight.
It was the ++ operator, +1 worked better...

I have a conceptual problem though. http://www.dianalehr.com:
When a user clicks a thumbnail, they go to a page with an enlargement...no
sweat, the page is created using a query built around a query strign
containing the piece ID.

On that page are prev and next lnks that go to the detail page, with the
current ID query string + or - 1 (in the event that the current ID is the
beginning or end of the array, these links go to the beginning or end of the
array..ie if ID = max_id, link = 1. if ID = 1, prev link = max_id.)

So...thats not quite good enough.

The index page has pieces divided into categories based on medium. I need
the links on the enlargement page to cycle through the paintings in the same
order, but I'm not sure how to do that. If I make the link query string to
contain ID and category variables, I could loop through all the pieces in
that category, but the logic to get to the end of items in a category then
jump to the next category is beyond me...

Anthony? Daniel?

thanks guys.
jc
<tip type="local PHP/MySQL development">
I always try to set my scripts up so I don't have to change variables
between server and local dev machine. That means instead of running my
scripts as root on localhost (which is easiest) I have to create Users with
passwords in MySQL, but thats easy. PHPMyAdmin gives direct access to the
users and db tables of the MySQL database. I create users with the same
credentials as on the server adn associate them with their respective
database(s). If the server is using a db on another machine, I'll set the
value of $host for the DB connect routine based on $HTTP_HOST:
if ($HTTP_HOST == "localhost"){
...
$server = "localhost";
}
else{
...
$server = "my.database.server";
}
That way, i can run code on my machine in HomeSite or on the server, without
having to remember to manually set variables to connect to the database...
</tip>





More information about the thelist mailing list