porta325 Posted November 19, 2007 Share Posted November 19, 2007 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 More sharing options...
stuffradio Posted November 19, 2007 Share Posted November 19, 2007 For one thing... you're using the while statement twice... and I think you're nullifying $row by using it in both of the while statements Link to comment https://forums.phpfreaks.com/topic/78001-while-issue/#findComment-394776 Share on other sites More sharing options...
porta325 Posted November 19, 2007 Author Share Posted November 19, 2007 $row works either way, changing it does nothing. My problem is merging those 2 while statements in a way they would work. Link to comment https://forums.phpfreaks.com/topic/78001-while-issue/#findComment-394779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.