skull Posted May 14, 2007 Share Posted May 14, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/51299-solved-php-sessions/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.