corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » PHP Help


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author PHP Help
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
16th Mar 05 at 15:11   View User's Profile U2U Member Reply With Quote

Could someone show me the code to pull data from a MySQL database and store it in a session/array on the click of a button.

Cheers, James
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
16th Mar 05 at 15:22   View User's Profile U2U Member Reply With Quote

What exactly are you wanting to do with it?

James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
16th Mar 05 at 15:25   View User's Profile U2U Member Reply With Quote

Well im trying to create an online bike shop for a uni project, basically i have a page with a list of bike details and pictures etc, with a button to hire and a button to buy. when you click either button i want it to take the relevant bikes details from the database and store it into a session, so that the data can be used on a shopping basket page later on.

Hope that explains it ok
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
16th Mar 05 at 15:40   View User's Profile U2U Member Reply With Quote

This might not be the best way, but this is how I'd do it:


Retrieve the info from the table using the BikeID that was passed to the script from the button (using the GET method probably)

Assign to a variable. Ie. BikeColour
Assign to a session key $_session['bikecolour']=$BikeColour

Any help?

 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » PHP Help 23 database queries in 0.0047929 seconds