imod3rn Posted November 9, 2011 Share Posted November 9, 2011 Okay guys, so i have a status checker connected to a mySql database. Now, what i want to do is have it check the status, then update the field in the table. Here is my code, please someone add or tell me how to add the update mysql thing. <?php error_reporting(0); include '../dbc.php'; if(isset($_GET['id'])) { $id = intval($_GET['id']); //We check if the user exists $dn = mysql_query('select * from users where id="'.$id.'"'); if(mysql_num_rows($dn)>0) { $dnn = mysql_fetch_array($dn); //We display the user datas $offline='<font color="red">Offline</font>'; $online='<font color="green">Online</font>'; $host=(htmlentities($dnn['server_ip'])); $style=(htmlentities($dnn['style'])); $port=htmlentities($dnn['port']); $fp = fsockopen($host, 43594, $errno,$errstr, 4); if (!$fp){ echo('<font color="red">Offline</font>'); } else { $online=echo('<font color="green">Online</font>'); fclose($fp); } } } ?> Thanks, hope so one can help me Quote Link to comment https://forums.phpfreaks.com/topic/250746-fsockopen-and-updating-a-database/ Share on other sites More sharing options...
freelance84 Posted November 9, 2011 Share Posted November 9, 2011 http://bit.ly/sH7T9K Quote Link to comment https://forums.phpfreaks.com/topic/250746-fsockopen-and-updating-a-database/#findComment-1286532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.