scmeeker Posted June 30, 2010 Share Posted June 30, 2010 I'm having trouble with the form updating. It seems I have all this code right but its still not updating the table. I have a form set up that pulls the information that's already in the table and then it can be edited (hence the need for updating) but when the update button is clicked, nothing is updated or changed. Now I'm working with session variables and wondering if they're being passed when the update button is clicked. I'm also wondering if I can make the "<form action="artist_profile_update.php" method="post" name="update">" PHP code to pass the SESSION variable? Here is the form: <form action="artist_profile_update.php" method="post" name="update"> <br /> <span class="titles">A bit about you:</span><br /> <span class="smallfont">update info </span><br /> <p> <textarea name="bio" rows=10 cols=90><?php echo $display_block = "$item_bio" ?></textarea></p> <br /> <span class="titles">artists</span><br /> <span class="smallfont">update info</span><br /> <p> <textarea name="other_artists" rows=10 cols=90><?php echo $display_block = "$item_other_artists" ?></textarea></p> <br /> <br /> <input type="submit" name="Submit" value="update"> </form> Here is the "form action file" artist_profile_update.php: ( I would also like to redirect this back to the original page.) <?php mysql_connect("localhost", "", "", "sgallery") or die(mysql_error()); mysql_select_db("sgallery") or die(mysql_error()); $item_bio = mysql_real_escape_string($_POST['bio']);; $item_other_artists = mysql_real_escape_string($_POST['other_artists']); $sql="UPDATE store SET bio='$item_bio', other_artists='$item_other_artists' WHERE username = '".$_SESSION["username"]."'"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } ?> Any suggestions?? I'm really stuck on this one. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/206312-trouble-with-updating-table-with-form/ Share on other sites More sharing options...
scmeeker Posted June 30, 2010 Author Share Posted June 30, 2010 resolved. Thanks for anyone who read! Quote Link to comment https://forums.phpfreaks.com/topic/206312-trouble-with-updating-table-with-form/#findComment-1079325 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.