|
Posted by newbie on 07/22/07 00:03
Say I have two tables
table1
---------------------------------------------------------------
| id | scanned | title |
---------------------------------------------------------------
| 01 | 0 | book |
---------------------------------------------------------------
| 02 | 0 | paper |
---------------------------------------------------------------
| 03 | 1 | paper |
---------------------------------------------------------------
table2
---------------------------------------------------------------
| id | owned_by | notes |
---------------------------------------------------------------
| 01 | tom | good |
---------------------------------------------------------------
| 01 | sam | boring |
---------------------------------------------------------------
| 02 | sam | terrific |
---------------------------------------------------------------
Can I join the two table an update the field 'scanned' on the rows
being selected? i.e., I am looking for something like:
$query = "SELECT table1.title, table1.scanned, table2.owned_by,
table2_notes ".
"FROM table1, table2 ". "WHERE table1.id = table2.id";
// (however, I want to update table1.scanned field of all the entries
being selected, and hopefully atomic to the above select)
Is it possible?
Thanks a lot
Navigation:
[Reply to this message]
|