Mark,

Is it a two-fer-one sale today?

> I'm now trying to UPDATE the three records with one query.
>
> Once the data is INSERTED into the db with this -
>
> insert into mytable (id,name,job_number,job_date) values
> ('1','Mark','AA1','2002-04-15'),
> ('2','Mark','AA2','2002-04-16'),
> ('3','Mark','AA3','2002-04-17');
>
> a form page is displayed where all the job_dates can be changed
(updated).
>
> I'm using this to update -
>
> $sql = "UPDATE mytable set job_date='$job_date' where job_number
> ='$job_number'";
> $result = @mysql_query($sql, $connection) or die.....;
>
> and it only changes the last record. Could someone kindly tell me what
I'm
> doing wrong.


There doesn't appear to be anything wrong!?
The UPDATE statement will amend every row that meets the WHERE clause
selection criteria.
If the table only consists of the records mentioned, then only the
single (if any) row with the matching job number will update, ie if
$job_number = "AA3" then only the last record will (possibly) change.

Did I miss something?
=dn


---------------------------------------------------------------------
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

Reply via email to