chocopi Posted May 14, 2007 Share Posted May 14, 2007 This code is meant to get the id from the url and is meant to get the data from the table. however, in between the two //html there is $username and this is obviously meant to display the username however nothing is appearing. <?php $title = 'Edit Profile'; require_once ('page_header.php'); require_once ('url.php'); $inputcode = urlpart(); $query = "SELECT * FROM users WHERE id = '$inputcode'"; $result = mysql_query($query) or die(mysql_error()); $result = mysql_fetch_assoc($result); $username = ucfirst($result['username']); $email = $result['email']; $gender = $result['gender']; $orginal = $result['password']; $raw_password = $_POST['password']; $raw_confirm = $_POST['confirm']; print("<a href=\"memberspage.php\">Home Page</a>\n"); print("<br />\n"); print("<form name=\"edit_profile\" method=\"post\" action=\"$PHP_SELF\"> \n"); // html print(" $username \n"); // html require_once ('page_footer.php'); ?> Any help would be appreciated, ~ Chocopi Quote Link to comment https://forums.phpfreaks.com/topic/51380-solved-simple-problem-dont-know-how-to-put-into-words/ Share on other sites More sharing options...
sasa Posted May 14, 2007 Share Posted May 14, 2007 try to echo $inputcode is it pass ok? Quote Link to comment https://forums.phpfreaks.com/topic/51380-solved-simple-problem-dont-know-how-to-put-into-words/#findComment-253015 Share on other sites More sharing options...
chocopi Posted May 15, 2007 Author Share Posted May 15, 2007 where do i echo it ? and what will this do seeing as i would like the $username to appear Quote Link to comment https://forums.phpfreaks.com/topic/51380-solved-simple-problem-dont-know-how-to-put-into-words/#findComment-253393 Share on other sites More sharing options...
Barand Posted May 15, 2007 Share Posted May 15, 2007 The only way the username will have a value is if the query finds the record. The only way the query will find the record is if the value in $inputcode is correct. The easiest way to check if it is correct is to echo it so you can see what value it contains. Just simple debugging. echo $inputcode; Quote Link to comment https://forums.phpfreaks.com/topic/51380-solved-simple-problem-dont-know-how-to-put-into-words/#findComment-253401 Share on other sites More sharing options...
chocopi Posted May 15, 2007 Author Share Posted May 15, 2007 what it is, is that i am using lycos as an ftp and from some reason when you click on links is does not change the url and thats where i get the id from. so all i need to was open it in a new tab and it was fine Quote Link to comment https://forums.phpfreaks.com/topic/51380-solved-simple-problem-dont-know-how-to-put-into-words/#findComment-253764 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.