I have a script that pulls information from a table allflights.
$dbh=mysql_connect("localhost", "", "") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("");
$query = mysql_query("SELECT * FROM `allflights` WHERE flightno='UK18' ORDER BY date ASC") or die (mysql_error());
while ($row = mysql_fetch_array($query)) {
$pilot_info = $row["pilot_id"];
$date = $row["date"];
$hub = $row["hub"];
----------------------------------------------------------------------
table stuff is here
the table then prints out and displays a list of pilot_info
number2
number3
number4
and so on
I would like to pull further information from another table, ie members using the pilot_info that the first query grab's so I would for example like to get his name from the members table based upon his pilotnumber from this table and insert the data into this table also inorder for this to be viewed.
but I am unsure how to go about doing this or if indeed it is possible can anyone help me out or point me to the correet subject to solve this matter.
kind regards
Lee
Also can anyone help me understand this
when calling information from a table is there a command to stop it repeating the same information over and over again.
for example if i had country as a field in my table but had placed england in that field multiple times and then called this info to a table i would see england repeated for every one i had entered. Is there a way to restrict the times this data would be called and only perhaps show england once.