Hello,
I'm new to php. Can u suggest me how to send a session variable to mysql database. Actually i want the username to be sent to the database when the user uploads any document in my website.
Exactly the same way you'd store the value of any other variable in the database....?
What exactly is the problem you're having?
take session variable in one variable and pass it to ur query...
$variable = $_session['session_variable'];
$sql="insert into user set uname='$variable'";
Or save carpal tunnel and do even less typing:
$sql="insert into user set uname='$_SESSION[session_variable]'";
Of course, you might consider using [man]mysql_real_escape_string/man depending upon what data you're working with.