Jump to content

while issue


porta325

Recommended Posts

Hey guys,

I'm having a small problem here.I have to use a while statement to get the $your_link variable out of mysql.But when i use it i get everything false. If i set the variable manualy like this($your_link = ("somesite.com")) works like a charm. Anyone can see where i made the mistake ? Thank you.

 

<?php

mysql_connect("localhost", "user", "pass") or die(mysql_error());

mysql_select_db("directory") or die(mysql_error());

$result1 = mysql_query ("SELECT your_link FROM personaldata");

while ($row = mysql_fetch_array ($result1)){

$your_link=$row['your_link'];

 

 

$result = mysql_query ("SELECT recip_url FROM link");

while ($row = mysql_fetch_array ($result)){

$recip_url=$row['recip_url'];

$content = @file_get_contents($recip_url);

$pos = strpos($content, $your_link);

if ($pos === false) {

echo "no";

}

else

{

echo "yes";

}

}

}

?>

Link to comment
https://forums.phpfreaks.com/topic/78001-while-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.