I've this little cute script for a small searchscript:
$query="SELECT *
FROM artikel AS a, verslag AS v
WHERE a.tekst LIKE '%$zoekterm%'
OR v.tekst LIKE '%$zoekterm%'";
$uitvoer=mysql_query($query) or die("FOUT: " . mysql_error());
$headerres="Resultaten";
while($resultaat=mysql_fetch_array($uitvoer))
{
$tekstres .=
"<TR>
<TD>".
stripslashes($resultaat[titel])."
</TD>
</TR>";
}
table($headerres, $tekstres);
echo"<br>";
My problem is, while there is a column called titel (dutch for title) in both tables (verslag and artikel) the array $resultaat[titel] only shows the results of the last table (verslag). The first column results are count, but the names (titel) are replaced by the names of the last column (verslag).
So what I need to know of you is how I can tell my code that it has to echo verslag.titel or artikel.titel instead of only the last column.
Thanx for your help!