Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

47 users online



Problems with listing from multiple tables

Problems with listing from multiple tables

Currently viewing this thread: 1 (0 members and 1 guests)


tcbil

tcbil

I hate Customer Services!
Status: Offline!

Problems with listing from multiple tables

I have the following code

PHP:

<?php
            
echo ("<p class=\"side_title\"><b>Scorers Listing</b></p>");
            
$result mysql_query("SELECT * FROM Football_scorers ORDER BY f_scorers_id DESC");
            while(
$r=mysql_fetch_array($result))
            {  
                   
extract($r);
                    
$result mysql_query("SELECT * FROM Football_players WHERE f_players_id=$f_scorers_players");
                    while(
$r=mysql_fetch_array($result))
                    {  
                           
extract($r);
                           echo (
"<p>$f_players_name - $f_players_type");
                    }
                    
                    
$result mysql_query("SELECT * FROM Football_games WHERE f_games_id=$f_scorers_games");
                    while(
$r=mysql_fetch_array($result))
                    {  
                           
extract($r);
                           echo (
"- $f_games_date</p>");
                    }
            }
?>

In the scorers table i have multiple entries however it is only listing one entry on the website, i know there is a simpler way of doing this but i can't remember for the life of me.

Any help would be appreciated.

Thanks

___________________

PHP Freak Wannabe!

tcbil

tcbil

I hate Customer Services!
Status: Offline!

Have resolved it!

PHP:

<?php
            
echo ("<p class=\"side_title\"><b>Scorers Listing</b></p>");
            
$result mysql_query("SELECT * FROM Football_scorers,Football_games,Football_players WHERE Football_scorers.f_scorers_players=Football_players.f_players_id AND Football_scorers.f_scorers_games=Football_games.f_games_id");
            while(
$r=mysql_fetch_array($result))
            {  
                   
extract($r);
                echo (
"<p>$f_players_name - $f_players_type - $f_games_date");
            }
?>

Sorry for any hassle

___________________

PHP Freak Wannabe!

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0075 seconds.