I think the title is quite straightforward but basically I have 2 mysql tables that hold various information. Linking them together is a unique id.
One of the tables is showing a total of 2 rows less than the other. I would like to run through these rows and find out which id values are missing. I do not know enough of mysql to say that this is not possible using only mysql but i thought it would be an easier task with php.
so something like this which really is a thumbsuck :
if ($stmt = $link->prepare("
SELECT i.id AS itemsId, c.item_id AS catsId
FROM items i
INNER JOIN item_categories c
WHERE i.id = c.item_id
"))
{
$stmt->execute();
$stmt->bind_result($id1, $id2);
$stmt->close();
}
while ($stmt->fetch())
{
*run through the numbers and echo which numbers are missing out of 1 to 300.*
}
Would anyone have any idea on how i could accomplish something like this?
Any advice, suggestion or information would be greatly appreciated, thank you!
1 Answer