elite_prodigy Posted March 27, 2008 Share Posted March 27, 2008 My staff members can place HTML into their profile with the text box I have provided, but When I want to call it back to the text box so they can see what they are editing when making updates, I can't. I always get a blank text box. I use the following to attempt to achieve this: <?php $retrieve_profile="SELECT * FROM members WHERE username='$_SESSION[user]' and id='$_SESSION[id]'"; $return_profile=mysql_query($retrieve_profile); $content_profile = mysql_fetch_array($return_profile); $display_profile = "<h4>Update Your Profile</h4> <form method=\"post\" action=\"profile.php\"> <textarea name=\"profile\" rows=\"10\" cols=\"50\" wrap=\"virtual\">$content_profile[profile]</textarea><br /> <input type=\"submit\" name=\"submit\" value=\"Save Changes\" /> </form> "; ?> This always renders a blank text box. Link to comment https://forums.phpfreaks.com/topic/98233-logic-error-with-profile-generation/ Share on other sites More sharing options...
elite_prodigy Posted March 27, 2008 Author Share Posted March 27, 2008 And now I'm returning this error for some reason: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/david08/public_html/hasdsecret.co.cc/admin/index.php on line 24 Link to comment https://forums.phpfreaks.com/topic/98233-logic-error-with-profile-generation/#findComment-502607 Share on other sites More sharing options...
cooldude832 Posted March 27, 2008 Share Posted March 27, 2008 use proper error checking on your query <?php retrieve_profile="SELECT * FROM members WHERE username='$_SESSION[user]' and id='$_SESSION[id]'"; $return_profile=mysql_query($sql) or die(mysql_error()."<Br /><br />".$sql); $content_profile = mysql_fetch_array($return_profile); $display_profile = "<h4>Update Your Profile</h4> <form method=\"post\" action=\"profile.php\"> <textarea name=\"profile\" rows=\"10\" cols=\"50\" wrap=\"virtual\">".$content_profile['profile']."</textarea><br /> <input type=\"submit\" name=\"submit\" value=\"Save Changes\" /> </form> "; ?> Link to comment https://forums.phpfreaks.com/topic/98233-logic-error-with-profile-generation/#findComment-502610 Share on other sites More sharing options...
sstangle73 Posted March 27, 2008 Share Posted March 27, 2008 nvm use his Link to comment https://forums.phpfreaks.com/topic/98233-logic-error-with-profile-generation/#findComment-502612 Share on other sites More sharing options...
elite_prodigy Posted March 27, 2008 Author Share Posted March 27, 2008 RESOLVED! THANKS!! *Bows at superiority* Link to comment https://forums.phpfreaks.com/topic/98233-logic-error-with-profile-generation/#findComment-502618 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.