Jump to content

Logic ERROR with profile generation


elite_prodigy

Recommended Posts

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

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

 

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>
";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.