almightyegg Posted January 14, 2007 Share Posted January 14, 2007 i have a page like this:[code=php:0]<?if(!$p){}elseif($p=="view"){//page info}elseif($p=="edit"){//page info}[/code]so the link is profile.php?p=view or edit but in view i also have this:[code=php:0]$GET = id;$first = "SELECT * FROM users WHERE id = '$GET'";$second = mysql_query($first);$profile = mysql_fetch_assoc($second);//other stuffecho "$profile[firstn] $profile[lastn]";?>'s Profile[/code]so that is then profile.php?p=view&id=1 (is my id)except is doesn't echo out the $profile bits ??? any ideas Link to comment Share on other sites More sharing options...
mattd8752 Posted January 14, 2007 Share Posted January 14, 2007 Make sure it is actually in an array (the profile variable) and not just multiple variables. Then try:echo $profile['firstn']."".$profile['lastn']; Link to comment Share on other sites More sharing options...
almightyegg Posted January 14, 2007 Author Share Posted January 14, 2007 how would i make sure it is an array...sorry i'm not so good with php :-[ Link to comment Share on other sites More sharing options...
mattd8752 Posted January 14, 2007 Share Posted January 14, 2007 Give me the errors if there are any from that second part I gave you and I can tell you if it is an array? I'll show you how for next time. If it says something about non-existing array or something like that it is definitely the array. Link to comment Share on other sites More sharing options...
almightyegg Posted January 14, 2007 Author Share Posted January 14, 2007 when trying:echo $profile['firstn']."".$profile['lastn'];it displays the same as it had before...no difference...just doesn't show anything Link to comment Share on other sites More sharing options...
mattd8752 Posted January 14, 2007 Share Posted January 14, 2007 $GET = id;Is it supposed to be $id? Link to comment Share on other sites More sharing options...
almightyegg Posted January 14, 2007 Author Share Posted January 14, 2007 yay! it works :) thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts