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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.