0

I have a simple query:

$query = "SELECT
Item_Name, Item_wiki, Item_Website
FROM
items_list";

$result = mysql_query($query, $db) or die(mysql_error($db));
// loop through the results
while ($row = mysql_fetch_assoc($result)) {
extract($row);

I want to put another query inside it. I have a second table (item_clip) that holds the photos for each Item_Name. It's fields are clip_name, clip_photos.
items_list.Item_Name=item_clip.clip_name

How do I identify how many rows of photos the second table has for each entry in my first table?

(many thanks in advance from a humble nube)

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by iwanwh
0

Well I worked out my problem... I was perusing down the SQL forum and a guy asks about having two databases going at once. Well that's what I've done; I've nested one open database in another:

$db2 = mysql_connect...
$query2 = "SELECT...
$result2 = mysql_query($query2, $db2) or die(mysql_error($db2));
$num_clips = mysql_num_rows($result2);

and then connected both tables with:

WHERE
clip_name ='$Item_Name'

The more I study PHP/Mysql, the more I realise how thick I am :-(

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.