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.

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.