Current session user values in mysql
i need the current session user values in mysql pls send me the query
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suraj SahooRank #382 · 6.6K reputationPosted Feb 11, 2015, 9:01 PM EST
Please follow the below links.
They will surely help you
http://stackoverflow.com/questions/5818917/is-it-possible-to-a-create-session-variable-in-javascript
http://www.codeproject.com/Articles/633199/Using-MySQL-Session-State-Provider-for-ASP-NET
Thanks
Accept if this helps anyway.
venkatesan srinivasan9 reputationPosted Feb 11, 2015, 9:22 PM EST
Francis SusaimichaelRank #466 · 5.4K reputationPosted Feb 11, 2015, 10:49 PM EST
venkatesan srinivasan9 reputationPosted Feb 12, 2015, 12:03 AM EST
1. i m log in one user name for eg(emp1)
2.i need the session name to display
3. i extract the data from my sql from the current session user
my db fildes (no,username,exp1,exp2,exp3,total)
Francis SusaimichaelRank #466 · 5.4K reputationPosted Feb 12, 2015, 12:35 AM EST
1. Hope that you can capture the user name from the text box. Then You can store it session like below:
Session["UserName"]= txtUserName.Text;
2. Hope that you are using "label" like control to display the user name.
string strUserName = Convert.ToString(Session["txt"]);
lbl.Text=strUserName;
3.Try the below code to retrieve the info. Here i have used "SQL" based connection object you should substitute "MySQL" based connection objects.
using (SqlConnection con = new SqlConnection("YourConnectionString"))
{
SqlCommand cmd = new SqlCommand(String.Concat("Select no,username,exp1,exp2,exp3,total from YourTableName where username='",strUserName,"'" );
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt= new DataTable();
da.Fill(dt);
}
If you have any clarification, let me know.
venkatesan srinivasan9 reputationPosted Feb 12, 2015, 12:42 AM EST
Suraj SahooRank #382 · 6.6K reputationPosted Feb 12, 2015, 1:09 AM EST
http://www.sitepoint.com/users-php-sessions-mysql/
http://stackoverflow.com/questions/17075424/get-the-data-of-specific-user-in-php
Accept if helps.
Thanks
venkatesan srinivasan9 reputationPosted Feb 12, 2015, 2:06 AM EST