Changeset 20052 for trunk/FACT++/www/schedule/load.php
- Timestamp:
- 03/24/21 22:28:33 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/schedule/load.php
r18720 r20052 9 9 // ================================================================ 10 10 11 function query($ query)11 function query($sql, $query) 12 12 { 13 $sql = mysql_query($query);13 $sql = $sql->query($query); 14 14 if (!$sql) 15 die( mysql_error());15 die($sql->error); 16 16 17 17 $rows = array(); 18 while($row = mysql_fetch_assoc($sql))18 while($row = $sql->fetch_assoc()) 19 19 $rows[] = $row; 20 20 … … 43 43 require_once 'config.php'; 44 44 45 $db = mysql_connect($dbhost,$dbuser,$dbpass); 46 if (!$db) 47 die(mysql_error()); 45 $sql = new mysqli($dbhost, $dbuser, $dbpass); 48 46 49 if (!mysql_select_db($dbname, $db)) 50 die(mysql_error()); 47 if ($sql->connect_error) 48 die($sql->connect_error); 49 50 if (!$sql->select_db($dbname)) 51 die($sql->error); 51 52 52 53 /*mixed date_sunrise ( int $timestamp [, int $format = SUNFUNCS_RET_STRING [, float $latitude = ini_get("date.default_latitude") [, float $longitude = ini_get("date.default_longitude") [, float $zenith = ini_get("date.sunrise_zenith") [, float $gmt_offset = 0 ]]]]] )*/ 53 54 54 query( "SELECT DISTINCT(DATE(ADDTIME(fStart, '-12:00'))) AS 'd' FROM Schedule");55 query( "SELECT fSourceKEY AS 'key', fSourceName AS 'val' FROM Source WHERE fSourceTypeKEY=1");56 query( "SELECT fMeasurementTypeKEY AS 'key', fMeasurementTypeName AS 'val' FROM MeasurementType");57 query( "SELECT * FROM Schedule WHERE DATE(ADDTIME(fStart, '-12:00:00')) = '".$_POST['n']."'".$cut."ORDER BY fStart ASC, fMeasurementID ASC");55 query($sql, "SELECT DISTINCT(DATE(ADDTIME(fStart, '-12:00'))) AS 'd' FROM Schedule"); 56 query($sql, "SELECT fSourceKEY AS 'key', fSourceName AS 'val' FROM Source WHERE fSourceTypeKEY=1"); 57 query($sql, "SELECT fMeasurementTypeKEY AS 'key', fMeasurementTypeName AS 'val' FROM MeasurementType"); 58 query($sql, "SELECT * FROM Schedule WHERE DATE(ADDTIME(fStart, '-12:00:00')) = '".$_POST['n']."'".$cut."ORDER BY fStart ASC, fMeasurementID ASC"); 58 59 59 60 //sleep(3);
Note:
See TracChangeset
for help on using the changeset viewer.