Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $mysql_host = "";
- $mysql_database = "";
- $mysql_user = "";
- $mysql_password = "";
- $con = mysql_connect($mysql_host, $mysql_user, $mysql_password);
- if (!$con)
- {
- die('Could not connect to the database: ' . mysql_error());
- }
- mysql_select_db($mysql_database, $con);
- foreach($_POST as $key => $value)
- {
- $pieces = explode("_", $value);
- $id = $pieces[0];
- $name = $pieces[1];
- $cur = $pieces[2];
- $max = $pieces[3];
- $state = $pieces[4];
- $sql = "UPDATE serverstats SET name=\"$name\", cur=$cur, max=$max, state=$state WHERE id=$id";
- mysql_query($sql) or die('Could not query the database: ' . mysql_error());
- }
- mysql_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement