Hi there,
I have a database for managing points of members.
The database is constructed by
|id (primary, unique, AI) | name | rank | points | class
|123 |name1|Officer|20 |Warrior
The list consists of about 30 different id's for each member added to the list.
What i want to do is to create bulk actions. So i can mark several/all members and add a set of points to existing points.
The form i use is:
And for each member they get:
Now, this form is being sent to update_bulk.php witch look like this:
Now, i'm a real noob when it comes to PHP/Mysql, so i could really use some help with this PHP/Mysql action.
What i want is for the script to update the points value of all id's sent to it.
Not only paste in the same number but to add the value, so if i write 20 in ud_points i want it to add those to existing value.
Anyone who has a clue?
I have a database for managing points of members.
The database is constructed by
|id (primary, unique, AI) | name | rank | points | class
|123 |name1|Officer|20 |Warrior
The list consists of about 30 different id's for each member added to the list.
What i want to do is to create bulk actions. So i can mark several/all members and add a set of points to existing points.
The form i use is:
HTML:
<form action="update_bulk.php" method="post" />
<input type="text" name="ud_points" value="Points"/>
<input type="submit" value="Quick Edit" />
And for each member they get:
HTML:
<input type='checkbox' name='ud_id' value='$id' />
Now, this form is being sent to update_bulk.php witch look like this:
PHP:
$ud_id=$_POST['ud_id'];
$ud_points=$_POST['ud_points'];
require_once('mysql.php');
$query="UPDATE members SET points='$ud_points' WHERE id='$ud_id'";
mysql_query($query);
Now, i'm a real noob when it comes to PHP/Mysql, so i could really use some help with this PHP/Mysql action.
What i want is for the script to update the points value of all id's sent to it.
Not only paste in the same number but to add the value, so if i write 20 in ud_points i want it to add those to existing value.
Anyone who has a clue?