Ignore:
Timestamp:
03/24/21 22:28:33 (4 years ago)
Author:
tbretz
Message:
Updated mysql calls.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/schedule/save.php

    r18797 r20052  
    134134// ================================================================
    135135
    136 $db = mysql_connect($dbhost,$dbuser,$dbpass);
    137 if (!$db)
    138     die(mysql_error());
    139 
    140 if (!mysql_select_db($dbname, $db))
    141     die(mysql_error());
     136$db = new mysqli($dbhost,$dbuser,$dbpass);
     137if ($db->connect_error)
     138    die($db->connect_error);
     139
     140if (!$db->select_db($dbname))
     141    die($db->error);
    142142
    143143$query = "SELECT * FROM MeasurementType";
    144144
    145 $sql = mysql_query($query);
     145$sql = $db->query($query);
    146146if (!$sql)
    147     die(mysql_error());
     147    die($db->error);
    148148
    149149$measurements = array();
    150 while($row = mysql_fetch_assoc($sql))
     150while($row = $db->fetch_assoc($sql))
    151151    $measurements[$row['fMeasurementTypeKey']] = $row;
    152152
     
    271271
    272272foreach ($queries as $query)
    273     if (!mysql_query($query))
    274         die(mysql_error());
    275 
    276 mysql_close($db);
     273    if (!$db->query($query))
     274        die($sql->error);
     275
     276$db->close();
    277277
    278278?>
Note: See TracChangeset for help on using the changeset viewer.