Hey guys,
Building a new video inventory system for my website. (MySQL)
Single Header record. (linked to a contract)
Multiple Detail Records - 4 in this case. (linked to the header record)
Multiple Inventory Records - again, 4 - (each detail record points to one specific inventory record, but the inventory may be the target of multiple detail records)
Optional Link records - 3 (the Link record is owned by a specific Inventory record, but it is an OPTIONAL record)
actual query
Testing, I know there are 4 records I want returned. I am getting 3. The 3 that have optional link information (an entry in the video_links table).
I have hit this problem in the past, but I just bailed, and used a separate query to gather the optional data.
Question: Is there a way to include that into a single query? Or does the fact that there is no entry in that third table preclude the record from being selected?

Building a new video inventory system for my website. (MySQL)
Single Header record. (linked to a contract)
Multiple Detail Records - 4 in this case. (linked to the header record)
Multiple Inventory Records - again, 4 - (each detail record points to one specific inventory record, but the inventory may be the target of multiple detail records)
Optional Link records - 3 (the Link record is owned by a specific Inventory record, but it is an OPTIONAL record)
actual query
Code:
$query = "SELECT
video_control_detail.id AS videoDetailId,
video_control_detail.video_inventory_id AS videoInventoryId,
video_control_detail.start_date AS videoDetailStartDate,
video_links.description AS videoLinkDescription,
video_links.link AS videoLinkTarget,
video_inventory.*
FROM
video_control_detail, video_inventory, video_links
WHERE video_control_detail.header_control_id = '$this->VideoInventoryControlId'
AND video_inventory.id = video_control_detail.video_inventory_id
AND video_links.video_id = video_control_detail.video_inventory_id
ORDER BY video_control_detail.start_date ASC";
Testing, I know there are 4 records I want returned. I am getting 3. The 3 that have optional link information (an entry in the video_links table).
I have hit this problem in the past, but I just bailed, and used a separate query to gather the optional data.
Question: Is there a way to include that into a single query? Or does the fact that there is no entry in that third table preclude the record from being selected?