[SOLVED] - While Statement issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

[SOLVED] - While Statement issue

Post 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
Last edited by iknownothing on Wed Mar 21, 2007 8:48 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

put the conditional inside the loop?
Post Reply