-
ping mysql query result
deal gurus,
I am new in PHP and mysql, my question have three parts,
Q1- i have php script to show ip from mysql database field "IPaddress" and its working fine.
script is:
<?PHP
$user_name = "root";
$password = "";
$database = "gfghoipmac";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "SELECT * FROM `ip` LIMIT 353, 1 ";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
print $db_field['IPaddress'] ;
}
mysql_close($db_handle);
}
else {
print "Database NOT Found ";
mysql_close($db_handle);
}
?>
Q2- second I have php script to ping an IP address and show "green.png file if ping successfuly" or "red.png if ping unsuccessfully" and this working fine.
script is:
<?php
$str = exec("ping -n 1 -w 2000 8.8.8.8", $input, $result);
if ($result == 0){
echo "<img src=\"green.png\">";
}else{
echo "<img src=\"red.png\">";
}
?>
my main question is 3rd.
Q3- I want to use mysql result IP address in php ping script plzz help me in this, I have tried alot, took too much GOOGLE but still unsuccessful.
please help.


-
-
Have you looked into PHP's curl functions? They will help, I think.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Hi
Have you able to solved this matter,im also trying to achieve the same thing ,it will be great help if can help
Thanks
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks