View difference between Paste ID: 3wc6jx9M and t7ZqE6LC
SHOW: | | - or go back to the newest paste.
1
<?php
2
error_reporting(E_ALL ^ E_NOTICE);
3
include_once('shop.php');
4
5
$db = mysql_connect('localhost','test','7990911qw');
6
mysql_select_db('test', $db);
7
8
$result = mysql_query("SELECT * FROM shop_server_rust ORDER BY id DESC LIMIT 1");
9-
$myrow = mysql_fetch_array($result);
9+
while ($myrow = mysql_fetch_array($result)) {
10
11
12
13
14
$rcon = new CServerRcon('127.0.0.1', 28016, '1212');
15
if($rcon->Auth())
16
{
17
$id = $myrow[id];
18
$item = $myrow[title];
19
$name = $myrow[username];
20
$amount = $myrow[amount];
21
22
if ($rcon->rconCommand("serv.give $name $item $amount")) {
23
24
mysql_query("DELETE FROM shop_server_rust WHERE id='".$id."'");
25
26
echo "'".$name."' Вы успешно купили '".$amount."' штук(и) '".$item."' ";
27
28
}
29
}
30
}
31
?>