Results 1 to 1 of 1
Feb 7, 2007, 03:34 #1
- Join Date
- Nov 2003
- United Kingdom
- 0 Post(s)
- 0 Thread(s)
Querying from mysql and then qeury again using that result set. Please Help
I have a slight problem. I am using a duplicate content filter and I now need to query and select each authors name from the table and then I need to use that name to query the table again to return all of the rows that include that authors name apart from the authors name that has the same id as the first queries result.
I need to do this so I can work through each authors name to see if they have submitted their articles 2 times, or have nearly duplicate articles on the database. I have so far put the following script together, but it doesn't seem to work.
It seems to be messing up on the while statements I believe in that it's giving the wrong results. I think the loops are done wrong or I should be using something else for the 1st queries loop.
$sqlc = mysql_query("SELECT
limit 0 , 5");
$sqlcnum = mysql_num_rows($sqlc);
while($sqlc2 = mysql_fetch_array($sqlc))
$str1 = strip_tags($sqlc2[description]);
$sqla = mysql_query("
while($sqla2 = mysql_fetch_array($sqla))
$str2 = strip_tags($sqla2[description]);
similar_text($str1, $str2, $p);
$artpercent = round($p);
if($artpercent > 33)
echo "Aut: $sqlc2[authname] 1st Art: $sqlc2[ided] Aut: $sqla2[authname] 2nd Art: $sqla2[ided] P: $artpercent%<br /><b>DESC 1:</b> $str1<br /><br /><b>DESC 2:</b> $str2<br />";
//mysql_query("DELETE FROM articlesled2 WHERE ided='$sqlc2[ided]'");
//mysql_query("DELETE FROM articlesled WHERE ided='$sqlc2[ided]'");
//mysql_query("DELETE FROM articlesl WHERE ided='$sqlc2[ided]'");