source: oceandb/jQuery_Prototype/admin/map-menu.php @ 65

Last change on this file since 65 was 65, checked in by jazz, 15 years ago
  • 改寫成從 data/map-menu.json 讀取 map-menu 的選單設定
File size: 863 bytes
Line 
1<?
2  require_once('db-config/connect-mysql.php');
3  $query = "SELECT DISTINCT data_type.serial AS type_id, data_type.parent_id, data_type.name AS TYPE , maincase_new.owner_org FROM data_type, maincase_new, maincase_detail WHERE maincase_detail.maincase_id = maincase_new.serial AND maincase_detail.type_id = data_type.serial ORDER BY type_id, owner_org";
4  if ($database_connect) mysql_select_db($database_connect) or die('USE '.$database_connect.' failed!');
5  $result = mysql_query($query) or die("Query failed! $query");
6  $rows   = mysql_num_rows ($result);
7  if ($rows != 0)
8  {
9    echo "[\n";
10    for ($i=0 ; $i < $rows ; $i++)
11    {
12      $col= mysql_fetch_row($result);
13      echo "{ \"type_id\" : " . $col[0] . ", \"parent_id\" : " . $col[1] . ", \"type_name\" : \"" . $col[2] . "\", \"owner_org\" : \"" . $col[3] . "\"},\n";
14    }
15    echo "]";
16  }
17?>
Note: See TracBrowser for help on using the repository browser.