Jump to content

updating multiple values MySQL table


wkilc

Recommended Posts

Apologies... I'm a noob trying to reverse engineer code.

 

I have a script that can retrieve values from a MySQL database (based on a session login that recognizes which user you are) and places those values  into the text fields of a form, pre-populating the form.

 

<?php
mysql_connect('localhost', 'db', 'password'); 
mysql_select_db('users');

$id     =  mysql_real_escape_string($_SESSION['userid']);
$select =  "SELECT * FROM user_info WHERE md5(Member_No) = '$id';";
$query  =  mysql_query($select);
if ($row = mysql_fetch_array($query)) {
?>
<form>
FIRST name: <input type="text" name="First" value="<?php echo stripslashes($row['First']); ?>" 
LAST name: <input type="text" name="Last"  value="<?php echo stripslashes($row['Last']); ?>" >
Birthday: <input type="text" name="Birthday" value="<?php echo stripslashes($row['Birthday']); ?>" 
<input type="submit" value="Submit">
</form>
<?php
}
?>

 

I want to be able to connect to that same database and update ALL the values (3 in the example above) with the single click of the form button.  I think I was told some time ago that it's not possible to update all the values at once?

 

Thanks,

 

~Wayne

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.