Retrieving information from MYSQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nitation
Forum Newbie
Posts: 10
Joined: Sat Aug 20, 2005 8:18 am

Retrieving information from MYSQL

Post by nitation »

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
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Retrieving information from MYSQL

Post by califdon »

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
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
Forum Newbie
Posts: 10
Joined: Sat Aug 20, 2005 8:18 am

Re: Retrieving information from MYSQL

Post by nitation »

Maybe am not asking my question right. Please bear with me.

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"];
 
?>
 
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
wasir
Forum Commoner
Posts: 49
Joined: Sun Jul 08, 2007 11:28 pm

Re: Retrieving information from MYSQL

Post by wasir »

You can add another field (user) in your table.

later in your query you can add

Code: Select all

WHERE `user`=$afso_usid
Post Reply