tags:

views:

33

answers:

2

Hi, I have an html table which contains records, comes from mysql db. Each row also contains id (PK) wrt db table record. Now I want to save record id in PHP Session variable, when I click on a row. To do this I used onclick property for each row & call a javascript function with record id as function parameter & it works fine but how could I save this id in PHP Session variable ? Thanks.

+1  A: 

That's not possible because PHP is server-side language. However, you can use ajax for that.

Here is an ajax tutorial:

http://www.w3schools.com/Ajax/Default.Asp

Sarfraz
A: 

To do this you probably need to use ajax. Which is where on a click event you could probably call a different php to save your values in session

sushil bharwani