Wayne
Bates wrote:
sorry red_slider
i've read that polish solution but i have no idea what he is talking about..
/* Connecting, selecting database */
$link = mysql_connect("localhost", "user", "password") or die("Could not connect : " . mysql_error());
echo "Connected successfully
";
mysql_select_db("xoops") or die("Could not select database");
/* Performing SQL query */
$query = "SELECT lid, title, url FROM x_mylinks_links";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
/* Printing results */
while ($line = mysql_fetch_array($result))
{
$sitename = $line[url];
echo "Checking $sitename
n";
$file = fopen ($sitename, "r");
if ($file)
{
// echo "$sitename : Exists
n";
fclose($file);
}
if (!$file)
{
echo "$sitename : Does not exist
n";
$sql = mysql_query("INSERT INTO x_mylinks_broken (lid, sender, ip) VALUES ($line[lid], 1, 192.168.0.1)");
}
}
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>