[eluser]kgill[/eluser]
[quote author="TheFuzzy0ne" date="1236717670"]
No. Not without using multiple queries and a PHP loop. Update only allows you to update a single row, whereas delete and insert can handle multiple rows.
[/quote]
I think you meant that the other way around, update and delete work on multiple rows and insert generally only inserts a single row.
[quote author="TheFuzzy0ne" date="1236717670"]
[quote author="RS71" date="1236716798"]Also, can I SELECT multiple rows from multiple tables in one query? I don't necessarily want to concatenate the rows returned from the different tables.[/quote]
Yes, you'll need to use a JOIN.[/quote]
Actually, in this case he wants to use UNION, a users favourite books & favourite tv shows are each going to be in a one to many relationship with the user and they're unrelated data. A join might give you what you want it's going to be a mess to deal with and it's going to be a cartesian product which is exceptionally bad when dealing with large sets - DBA's do not look kindly on queries with cartesian joins. Whereas a union will combine the two into one giant result set:
Code:
select 'favbook' source, books item from users_books where userid = 1
union
select 'favtv' source, shows item from users_tv where userid = 1
which gives something like:
source item
------ ----
favbook foo
favbook bar
favbook baz
favtv blah
favtv argle
favtv bargle