Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

update seperate records with a single button

U need to change the name of your checboxes and your check function:

    function check($id) {
        if (isset($_POST['attendance'][$id])) {
           return 'yes';
        } else {
           return 'no';

echo "<td align='center'>" . "<input
type=checkbox name='attendance[".$record['Id']."]'
value='". $record['Attendance'] . "' />

This way will u have an array of all the checkboxes with a link to the id of the attendant.

while ($students =
mysql_fetch_array($myData)) {
    $UpdateQuery = "UPDATE students SET
Attendance=' " . check($students['Id']) . " '
WHERE  Id=$students[Id]";
    mysql_query($UpdateQuery, $con);

On a sidenote. mysql_* functions are deprecated. U should move on to mysqli or PDO and start using prepared statements

Categories : PHP

Related to : update seperate records with a single button
Insert Multiple records in nodejs in single Query
You just need an array of arrays, like what values is in the example you provided. Your example var arr = category_ids.split(","); var values = [ arr ]; or simply var value = [ category_ids.split(",") ];

Categories : Node Js
Update grouped records with sequence in oracle
How about: begin transaction Get next sequence in a temp var Disable sequence update tablename set grp_ID = grp_ID + tmpVar-1 Select into tempVar max(grp_ID) from tableName Re-seed sequence based value now in tempvar+1 Re-enable sequence commit and end transaction But i'm confused by something when you add additional records later, they can't simply do sequence.nextval because it's only ne

Categories : SQL
Insert / Update Records in MS SQL 2008 based on a second table, then keep dates consistent
I have two suggestions. First, I think in your "copying records" select, your last selected column should be B.DATA rather than A.DATA. Second, you name your temp table as #TEMP_TABLE. Using the hash prefix makes this an actual temp table, which will be created in tempdb and will pass out of scope when the session ends and won't be visible to other sessions. With those two tweaks, your code appe

Categories : Sql Server
Combining multiple SQL UPDATE queries with a single WHERE statement
I think the query that you're actually looking for, based on your attempted query, is: UPDATE T2 SET T2.Column1 = CASE WHEN T1.Column2 = 'B' THEN T1.Column5 ELSE 'X' END, T2.Column2 = CASE WHEN T1.Column2 = 'C' THEN T1.Column6 ELSE 'X' END FROM Table2 T2, Table1 T1 WHERE T1.Column1 = 'A'

Categories : Sql Server
Toggle buttons contents when single button clicked
The simple way The simple way is making 2 keyboards with identical layout, one for displaying the normal characters and the other is for displaying the "shifted characters". Stack one keyboard on top of the other, and toggle the visibility of the keyboards based on the state of the shift button, you can do this in the shift button's Checked and Unchecked event handlers (declare shift button as a

Categories : C#
Recently Add
Cartesian product of associative array showing key and value - PHP
Datamapper orm save and update not working
find methods in COM object
PHP Keyword search not working with multiple words
Set a total based on items ordered, two types, and sometimes one type will not be ordered.
FB request to join a group, going around their official SDK
Using Google charts with php data?
OAuth2 integration with ExactOnline
libvirt-php receives the error: unable to connect to server Permission denied
How to echo results by sets of 2?
Why does PHP's sprintf not round 5s reliably?
php replace affects on replaced string
PHP Find and replace multiple similar entries
Replace PHP date output with pre-made images
How to install Laravel 4 packages on Windows
Using updateOrCreate for multiple data insert in Laravel
Storing products in a MYSQL database and then search and filter them?
Create order with PrestaShop's API
how to get latest messages from all users
Yii CMultiFileUpload Restrict Image width
Combine array by key factor
Semicolon after if condition in PHP - code still works
Get date using day of the week
soap web service with symfony
Seasonal Reservation system Day/month
is it possible to join a single table it self?
Attempting to compare two arrays PHP
Sticky Select Option
Eventbrite duplicate event entry
Pagination Not Working on custom post type in Wordpress
© Copyright 2017 Publishing Limited. All rights reserved.