Solar Posted March 10, 2010 Share Posted March 10, 2010 This will be a hard one to explain, or maybe I am going over board for nothing. $session = $_SESSION['username']; I have the session as username, Thats fine. $sql = "SELECT id, members, friendwith userlevel FROM friends ORDER BY id DESC,id LIMIT $offset, $rowsperpage"; Using the Pagenation script provided by PHP Freaks, works perfectly. I want to change the "Members" to the variable to $session but it's not working properly. What I want to do is list a simple friendlist using; echo $list[''] . "<a href=\"userinfo.php?user=" . $list['$session'] . "\">" . $list['$session'] . " <br />"; So when the session = Username, change that with Members for the SQL Database which for example; $session=Steven. I really confused myself, Once again I may be going over then what I need to. I'm guess my Question is, Is it possible to change the SQL statement from Members to show a specific name for eg. $session->Username? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/194718-showing-specific-sql/ Share on other sites More sharing options...
greatstar00 Posted March 10, 2010 Share Posted March 10, 2010 so, u want to change to this? if $session = steven $sql = "SELECT id, steven, friendwith userlevel FROM friends ORDER BY id DESC,id LIMIT $offset, $rowsperpage"; if this case, it is not possible if u dont have the column named steven, u dont want to do this i suggest adding a where clause Quote Link to comment https://forums.phpfreaks.com/topic/194718-showing-specific-sql/#findComment-1024014 Share on other sites More sharing options...
Solar Posted March 10, 2010 Author Share Posted March 10, 2010 Doh I'm an idiot.. I kinda said my questions in the wrong way. I didn't mean that but I think the "Where Clause" is the answer I am looking for! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/194718-showing-specific-sql/#findComment-1024019 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.