Hi, when a user login, i want yo use his session username to query a secific database. I am trying to use the code below but it is not working.

$username=$_SESSION['username'];

can someone help me.

Recommended Answers

ensure that session_start() is literally at the very top of your script.

Jump to Post

All 2 Replies

ensure that session_start() is literally at the very top of your script.

ensure that session_start() is literally at the very top of your script.

working now. thx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.