Problem Updating MySQL info (1 Viewer)

outlaw_magic

New member
Local time
Today, 15:20
Joined
Jan 26, 2008
Messages
2
Hey ok im making a online game (yea theres loads already)

the game is pretty much done but theres one things im stuck on.
each user has their own car garage. cars can be gained by purchase from a Dealership.

in the garage page the following information is displayed
Car ID
Car Name
Car Value
Car Damage
Car Location

now when a user clicks on the Car ID which is a link that looks like
<a href='garage.php?sel=$array['id]'>$array['id]</a>

the link displays as it should.

what i want users to be able to do is when they click on say on
car id number 1 which could be a fiat panda they are placed as using that car.

a user should only be able to get in one car at a time and if they click on another cars id then they are taken out of their current car and placed inside the new one.

if they are in a car already and they click that cars id again then they should be taken out of that car.

the problem is i cant figure out how to do this.

a owner for a car is listed by the cars owner under the garage field owner.

the using is done by the ENUM 0 = not using 1 = using


can someone help with this?
thanks
 

DanG

Registered User.
Local time
Today, 07:20
Joined
Nov 4, 2004
Messages
477
What if you were to use sessions to track the car#?
I am pretty new to php, but I do know you can track a user and their changes from page to page using sessions. Cookies may be the answeer as well if they want to exit and revisit the site and then start from where they left off.
 

outlaw_magic

New member
Local time
Today, 15:20
Joined
Jan 26, 2008
Messages
2
no this is not something for sessions or cookies
this has to be done using MySQL.

let me sum it up

user clicks ID link
puts them in car

if in car then removes from current and puts in new

click car id again get out of car.
 

Users who are viewing this thread

Top Bottom