Also try using the exec command with an array and that will provide the
result for you so you can verify if the command was successful using php...

Check here: http://www.php.net/manual/en/function.exec.php

BigDog


"Josh Evans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Database: sites
>
> I have to columns: "id" and "site". I will have approx 800 entries in the
db
> when I am finished and what I want it to do and start with 1st entry and
> ping the site and display in a table on the screen if it was able to ping
> site or not.
>
> This is what I have so far. My problem is I am not sure how to make it
> select a entry, perform the ping, record the results, and then continue to
> the next entry.
>
> <?
> $db = mysql_connect("localhost","","") or die("Problem connecting");
> mysql_select_db("josh") or die("Problem selecting database");
> $query = "SELECT * FROM josh.sites";
> $result = mysql_query($query) or die ("Query failed");
> $numofrows = mysql_num_rows($result);
> for($i = 0; $i < $numofrows; $i++) {
>     $row = mysql_fetch_array($result);
>     if($i % 2) { //this means if there is a remainder
>
>     $site = ".row['site'].";   <---- its not pulling a site from the
> database?
>
>
>     $host1 = `ping -n 4 $site`;
>
> if (eregi("reply", $host1)) {
>     echo "$site is up!";
> } else {
> echo ("$site is down!");
> }
>
> echo ("<p>");
> ?>
>
> Please Help!
>
> Josh Evans
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to