0

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.

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.