Re: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Chris Aitken
At 01:57 PM 6/06/2001, you wrote: Hi all, I have three tables in my (mysql) database: videos - ID, title, description, etc.. links - ID, videoID, actorID actors - ID, name, dateofbirth, gender, etc... what i need to do is return a particular video and all it's staring actors with just one

Re: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Christopher Ostmo
Simon Kimber pressed the little lettered thingies in this order... Hi all, I have three tables in my (mysql) database: videos - ID, title, description, etc.. links - ID, videoID, actorID actors - ID, name, dateofbirth, gender, etc... You need to be able to tie at least one field from

RE: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Ray Hilton
Something like: SELECT name, title, description from videos, actors, links where actors.ID = links.ID and videos.ID=videoID, and videos.ID = 20; ? But in just want one row? You could return all the names in one row (I think) using MySQL (I assume?) string functions... I have a funny feeling

Re: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Hugh Bothwell
SELECT video.id, video.title, video.description, actor.name FROM ( video INNER JOIN link ON link.videoID = video.id ) JOIN actor ON actor.id = link.actorID WHERE video.title LIKE $searchstr What you'll get is one query returning a bunch of rows, one for each actor. Then concatenate the actors

RE: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Simon Kimber
Christopher Wrote... You need to be able to tie at least one field from each table to one other field in another table, and then you can have a query like: SELECT videos.*, links.*, actors.* FROM videos, links, actors WHERE videos.VideoID = '$VideoID' AND links.VideoID = videos.VideoID

RE: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Christopher Ostmo
Simon Kimber pressed the little lettered thingies in this order... Christopher Wrote... You need to be able to tie at least one field from each table to one other field in another table, and then you can have a query like: SELECT videos.*, links.*, actors.* FROM videos, links,