recset Posted December 25, 2006 Share Posted December 25, 2006 I have two tables. (lets refer them as [b]Table A[/b] and [b]Table B[/b])I am trying to show how many records are in [b]Table B[/b], based off of the record ID of [b]Table A[/b] (the Record ID of Table B will sort Table A)All of this has to appear in a Repeated Region.Here is what I have so far, please help:[code]mysql_select_db($database_vlot, $vlot);$query_ShowComments = "SELECT * FROM comments WHERE WISDOM_ID = (SELECT max(id) FROM wisdom)";$ShowComments = mysql_query($query_ShowComments, $vlot) or die(mysql_error());$row_ShowComments = mysql_fetch_assoc($ShowComments);$totalRows_ShowComments = mysql_num_rows($ShowComments);[/code]Thanks Quote Link to comment Share on other sites More sharing options...
Barand Posted December 25, 2006 Share Posted December 25, 2006 SELECT a.id, COUNT(*) as numrecsFROM TableA a INNER JOIN TableB b ON a.id = b.id Quote Link to comment Share on other sites More sharing options...
recset Posted December 25, 2006 Author Share Posted December 25, 2006 How would I implement that into my current script?[code]mysql_select_db($database_vlot, $vlot);$query_ShowComments = "SELECT * FROM comments WHERE WISDOM_ID = (SELECT max(id) FROM wisdom)";$ShowComments = mysql_query($query_ShowComments, $vlot) or die(mysql_error());$row_ShowComments = mysql_fetch_assoc($ShowComments);$totalRows_ShowComments = mysql_num_rows($ShowComments);[/code]More or less, I do not need to code the 'show record count' in the above piece. Quote Link to comment Share on other sites More sharing options...
recset Posted December 26, 2006 Author Share Posted December 26, 2006 Anyone have any ideas??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.