Hi all,

This sounds to me like a common question but I haven't found quite what I
want anywaher (maybe I've been looking in the wrong place). So apologies
from a complete newbie.

I have built a database with 6 tables. The Master table contains keys to the
other 5 tables. I want to be able to display related data when I display
search results.

This is the code I've been using (trial and error) but although I get a row
for each fount record, I get an error in every table cell.


$result=mysql_query ("select * from MASTER,ACFTREF
      where MASTER.MFR_MDL_CODE=ACFTREF.CODE
      AND MASTER.N_NUMBER LIKE '$Serial%'
      AND MASTER.SERIAL_NUMBER LIKE '$Con%'
      ORDER BY MASTER.N_NUMBER"
);
?>
<table width=100% tr valign=top>
<td colwidth=15%>Serial
<td colwidth=35% align=right>Maufacturer
<td colwidth=35% align=left>Model
<td colwidth=15%>Con
</td></tr>
<?php
if ($row = mysql_fetch_array($result)) {
do {
 print ("<TR valign=top><TD bgcolor=yellow>N");
 print $row['MASTER.N_NUMBER'];
 print ("<td>");
 print $row['ACFTREF.MFR_NAME'];
 print ("<td>");
 print $row['ACFTREF.TYPE_ACFT'];
 print ("<td>");
 print $row['MASTER.SERIAL_NUMBER'];
    print ("<p></TD></TR>");
} while ($row = mysql_fetch_array($result)) ;
} else {print "Sorry, no results found!";}
}
?>

Just for info, the Master db holds 340,000+ records.

MTIA

George in Edinburgh


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to