Page 1 of 1

[SOLVED] - While Statement issue

Posted: Wed Mar 21, 2007 7:32 pm
by iknownothing
Hey guys,
I have this piece of code for a while statement...

Code: Select all

$checkweb = MYSQL_QUERY("SELECT url FROM web WHERE clientid = '$id'");

while ($row = mysql_fetch_assoc($checkweb)) { 
	
	$checkurl = $row['url'];
}
What I want to do is check a certail value $url against all $checkurl's, so I have this codeas well...

Code: Select all

if ($url == $checkurl) {
//DO THIS
}
I get the feeling that it is only checking the final result of the while statement (as its out of the loop), how would I go about getting it to check ALL $checkurl's?

Thanks

Posted: Wed Mar 21, 2007 7:45 pm
by John Cartwright
put the conditional inside the loop?