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
https://forums.phpfreaks.com/topic/210399-updating-multiple-values-mysql-table/
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.