…but I’m back with a headache maker.
[code=php]$recordset1 = mssql_query (“select distinct id from site where (name like ‘%$freetext%’) or (location like ‘%$freetext%’) or (state like ‘%$freetext%’)”, $handle);
while($arr1 = mssql_fetch_row($recordset1))
{
$recordset2 = mssql_query (“select * from object where site like ‘%$arr[0]%'”, $handle);
while($arr2 = mssql_fetch_row($recordset2))
{
echo “$arr2[0]”;
}
}
ok lets assume you have two “sites” US and Canada. So your first loop returns the id’s 1 and 2 (one for each site).
No you only have an object found both in US and Canada but because it’s embedded in the first loop it will display twice, but it should only display once.
If you want to check this code out, shoot me a pm and I’ll toss you the URL.
Let me know if you have questions, I’ll be happy to expand on anything that will you help me.