Jump to content

[SOLVED] PHP sessions


skull

Recommended Posts

Hi,

I'm creating a web page that reads a list of users from a mysql database.

it displays as a table showing the users id then name then

at the end of each user there is an option to edit(Which goes to a diff page) or delete the user(stays on same page).

I'm having trouble in accessing the user.

the code goes as follows.

session start

connect to DB...

$result=mysql_query(SELECT*...)

$rows=mysql_num_rows($result)

for($i=0;$i<$rows;$i++)

{

$data=mysql_fetch_row($result);

echo"$data[0]";

same as above for rest of data

print"<a href=\"delete.php\"</a> | <a href=\"edit.php\"</a>;

$data[0]=$_SESSION[username];//this is the problem

}

with the last line creates only the last userid on the table as the session.

what would I need to change so if I wanted to select a user further up the table?

 

Thanks in advance

 

S

Link to comment
https://forums.phpfreaks.com/topic/51299-solved-php-sessions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.