How do i retrieve data from mysql for a specific user. When a user login,i want to be able to retrieve data from a specific table in my database.
Thanks in Advance
Retrieving information from MYSQL
Moderator: General Moderators
Re: Retrieving information from MYSQL
Your question is not clear. You would need to tell us what your table structure is and what you mean by "user" (are you talking about different MySQL users or just users of your web site?).nitation wrote:How do i retrieve data from mysql for a specific user. When a user login,i want to be able to retrieve data from a specific table in my database.
Thanks in Advance
Re: Retrieving information from MYSQL
Maybe am not asking my question right. Please bear with me.
I have created a session in a file, here is the code below;
I have also included that piece of code as a file on every page. I want to know exactly how to retrieve information from my database that will be for the current user.
Thanks in advance
I have created a session in a file, here is the code below;
Code: Select all
<?php
session_start();
$afso_name=session_name();
$afso_sid=session_id();
$afso_usid=$_SESSION["afso_userid"];
?>
Thanks in advance
Re: Retrieving information from MYSQL
You can add another field (user) in your table.
later in your query you can add
later in your query you can add
Code: Select all
WHERE `user`=$afso_usid