Results 1 to 3 of 3
Thread: PHP click to change ?
-
05-25-2009, 10:12 AM #1Empowering Websites
- Join Date
- Mar 2008
- Location
- UK
- Posts
- 1,135
PHP click to change ?
Hello, just another quick PHP question here:
How would I go about making a small script whereby:
An image is shown, based on what is in the database.
So, image1 is currently being shown, as is referenced as "1" in the mysql db. I click on the image. Image changes to image2, and is updated in the db as "2". The same for 3, however,when I click on the 3rd image, it cycles back to image 1.
I'm not sure if that's clear enough for you :|Shamil Nunhuck, - Radon Systems Limited
█ VPS + Dedicated Server Hosting and Management
█ vBulletin / XenForo Hosting and Services
█ Server / Website Consultation
-
05-26-2009, 09:46 AM #2WHT Addict
- Join Date
- May 2008
- Posts
- 117
Make php script that displays images dynamically by using GET.
-
05-26-2009, 06:19 PM #3Temporarily Suspended
- Join Date
- Apr 2009
- Location
- localhost
- Posts
- 175
I would suggest you to use session variable for handling this. So that when session starts it will be 1 by default and for each click it changes the session variable using a counter and if it reaches 3 it resets the variable to 1 again.
updating db and getting it back will make unwanted query to the DB and obviously the loading time ...