<?PHP
mysql_connect("localhost", "root", "");
mysql_select_db("otserv");
$data = mysql_query("SELECT * FROM `news`;");
while($news = mysql_fetch_array($data))
var_dump($news);
unset($data);
mysql_close();
?>
while($news = mysql_fetch_array($data))
ECHO 'Text : '.$news['text'].' <br>';
ECHO $news['topic'];
ECHO $news['date'];
ECHO $news['author'];
ECHO $news['author_id'];
ECHO $news['image_id'];
ECHO $news['topic'];
<?PHP
if(!$_GET['name'])
die("Correct usage: ?name=Nickname+of+player");
$slots = array(
1 => "Head (1)",
2 => "Necklace (Amulet) (2)",
3 => "Backpack (3)",
4 => "Armor (4)",
5 => "Right Hand (5)",
6 => "Left Hand (6)",
7 => "Legs (7)",
8 => "Feet (8)",
9 => "Ring (9)",
10 => "Ammo (10)"
);
mysql_connect("localhost", "root", "");
mysql_select_db("otserv");
$data = mysql_query("SELECT `itemtype`, `sid`, `count` FROM `player_items` WHERE `player_id` IN (SELECT `id` FROM `players` WHERE `name` = '".addslashes($_GET['name'])."');");
while($item = mysql_fetch_array($data))
echo "Slot: ".$slots[($item['sid'] - 100)]." | ItemID: <input type=\"text\" name=\"itemtype\" value=\"".$item['itemtype']."\" /> | Count: <input type=\"text\" name=\"count\" value=\"".$item['count']."\" />";
unset($data);
mysql_close();
?>
Showed the first value only
PHP:while($news = mysql_fetch_array($data)) ECHO 'Text : '.$news['text'].' <br>'; ECHO $news['topic']; ECHO $news['date']; ECHO $news['author']; ECHO $news['author_id']; ECHO $news['image_id']; ECHO $news['topic'];
while($news = mysql_fetch_array($data))
{
echo 'Text : '.$news['text'].' <br>';
echo $news['topic'];
echo $news['date'];
echo $news['author'];
echo $news['author_id'];
echo $news['image_id'];
echo $news['topic'];
}
player_id pid sid itemtype count attributes
2 103 111 2674 1 [BLOB - 2bajtów]
2 110 112 2432 1 [BLOB - 0bajtów]
2 110 113 5480 1 [BLOB - 0bajtów]
2 110 114 6500 1 [BLOB - 2bajtów]