> That the thing see, the form(using GET instead of POST) sends data with > the new dates like this:- > > id=1&name=Mark&job_number=AA1&job_date=2002-5-19 > &id=2&name=Mark&job_number=AA2&job_date=2002-5-21 > &id=3&name=Mark&job_number=AA3&job_date=2002-5-25 > > and the UPDATE query like this:- > > > $sql = "UPDATE mytable set job_date='$job_date' where job_number > > ='$job_number'"; > > $result = @mysql_query($sql, $connection) or die.....; > > just updates the last record. > > Can the query be written so that it updates each of the three records? > > cheers > > Mark Hi Mark Your problem is misused of form transfer data please notify that by GET method the data transfer to server with name and equa sign (=) and then value each data seperate by & so
id=1&name=Mark&job_number=AA1&job_date=2002-5-19 mean the data have 3 elecment id,name and job_date as your data you send 9 element but use the same name so finally it only have 3 element and the value id the last assign so you will got at last id=3&name=Mark&job_number=AA3&job_date=2002-5-25 the first and the second set has over write so when you update data you got the last data (id=3) update only how to solve this problem you shoul declare the name seperate like this id1=1&name1=Mark&job_number1=AA1&job_date1=2002-5-19 &id2=2&name2=Mark&job_number2=AA2&job_date2=2002-5-21 &id3=3&name3=Mark&job_number3=AA3&job_date3=2002-5-25 and update 3 time $sql = "UPDATE mytable set job_date='$job_date1' where job_number ='$job_number1'"; @mysql_query($sql, $connection) or die.....; $sql = "UPDATE mytable set job_date='$job_date2' where job_number ='$job_number2'"; @mysql_query($sql, $connection) or die.....; $sql = "UPDATE mytable set job_date='$job_date3' where job_number ='$job_number3'"; @mysql_query($sql, $connection) or die.....; May be your answer. Kittiphum Worachat,M.T. www.hatyailab.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php