I wan't to create a code that in a while loop list the content of table1 while looking for a matching result in table2.
Table1 contains the main data
Table2 contains keywords and description for the names in table1.
example:
Table1
ID - Title
1 - Intel core 2
2 - Intel Quad
3 - Amd 3200+
Table2
Titl - Description
Intel - A Processor
Amd - Another Processor
This code below kinda shows what i wan't todo, but does obviously not work
Code: Select all
//list from table1
while(list($id, $title) = mysql_fetch_row($go->lists)) {
$i++;
echo $title;
//list from table2
$query = "SELECT * FROM info where titl LIKE '%$title%'";
$result = mysql_query($query);
if (mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
echo $row['Description'];
}else{
}
}Thanks