Jump to content

[SOLVED] Update Error


stuart7398

Recommended Posts

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

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.