stuart7398 Posted April 9, 2008 Share Posted April 9, 2008 Hi. I have a members area. I'm trying to allow my users to update their details. Any positive suggestions / examples / corrections appreciated. Thanks, Stuart. I'm getting the following error: <code> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/users/abc/html/abc.com/abc/update-account.php on line 16 </code> <code> <?php require '../conn/config.php'; require '../conn/opendb.php'; $username = "$SESS_MEMBER_ID"; if(isset($_POST['save'])){ $firstname = mysql_real_escape_string($_POST['firstname']); $pin = mysql_real_escape_string($_POST['pin']); mysql_query("UPDATE members SET firstname='$firstname', pin='$pin' WHERE username='$username'"); } list($firstname, $pin) = mysql_fetch_array(mysql_query("SELECT firstname, FROM members WHERE member_id = '$SESS_MEMBER_ID'")); echo ' <form method="post" action=""> <p>First Name <input type="text" name="firstname" size="24" value="'.$firstname.'" /></p> <p>pin <input type="text" name="pin" size="24" value="'.$pin.'" /></p> <p> <input type="submit" value="save data" name="save" /> </p> </form> '; ?> </code> Link to comment https://forums.phpfreaks.com/topic/100310-solved-update-error/ Share on other sites More sharing options...
kingnutter Posted April 9, 2008 Share Posted April 9, 2008 Might it be a rogue comma after SELECT firstname? here: list($firstname, $pin) = mysql_fetch_array(mysql_query("SELECT firstname, FROM members WHERE member_id = '$SESS_MEMBER_ID'")); Link to comment https://forums.phpfreaks.com/topic/100310-solved-update-error/#findComment-512944 Share on other sites More sharing options...
stuart7398 Posted April 9, 2008 Author Share Posted April 9, 2008 Thanks. I've noticed the form 'action' empty. where do i post the form to? tutorial / suggestions / ideas appreciated Stuart. Link to comment https://forums.phpfreaks.com/topic/100310-solved-update-error/#findComment-512956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.