Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "config.php";
- $data_array_json = "[";
- $db = mysql_connect($db_host, $db_username, $db_password, $db_name);
- mysql_select_db($db_name, $db) or die (mysql_error());
- $query = mysql_query("SELECT * FROM FIGHTERS_DEFAULT", $db);
- if(!$query) {
- echo "Error! ".mysql_error();
- exit;
- }else {
- $index = 0;
- while ($row = mysql_fetch_array($query))
- {
- if ($index > 0) $data_array_json .= ",{";
- else $data_array_json .= "{";
- $data_array_json .= ""
- ."\"id\": "."\"".$row['id']."\"".","
- ."\"character\": ["
- ."{"
- ."\"text\": "."\"".$row['DEFAULT_NAME']."\"".","
- ."\"width\": "."\"300\"".","
- ."\"height\": "."\"100\"".","
- ."\"size\": "."\"40\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"10\"".","
- ."\"y\": "."\"0\""
- ."},{"
- ."\"text\": "."\"Уровень ".$row['DEFAULT_LEVEL']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"50\""
- ."},{"
- ."\"text\": "."\"Жизнь ".$row['DEFAULT_HP']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"80\""
- ."},{"
- ."\"text\": "."\"Мана ".$row['DEFAULT_MANA']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"110\""
- ."},{"
- ."\"text\": "."\"Сила ".$row['DEFAULT_POWER']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"140\""
- ."},{"
- ."\"text\": "."\"Защита ".$row['DEFAULT_DEFENSE']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"170\""
- ."},{"
- ."\"text\": "."\"Ловкость ".$row['DEFAULT_SLEIGHT']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"200\""
- ."},{"
- ."\"text\": "."\"Интеллект ".$row['DEFAULT_INTELLECT']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"230\""
- ."},{"
- ."\"text\": "."\"Лидерство".$row['DEFAULT_LEADERSHIP']."\"".","
- ."\"width\": "."\"200\"".","
- ."\"height\": "."\"25\"".","
- ."\"size\": "."\"18\"".","
- ."\"color\": "."\"0xFFFFFF\"".","
- ."\"font\": "."\"Arial\"".","
- ."\"x\": "."\"300\"".","
- ."\"y\": "."\"260\""
- ."}]}";
- $index++;
- }
- }
- $data_array_json .= "]";
- echo $data_array_json;
- //echo "connect goog!";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement