private static function setIP($code) { $table = 'loginhistories'; if (self::hasIP()) { $query = 'UPDATE ' . $table . ' SET code = "' . $code . '", datetime = "' . Funcs::getDatetime() . '" WHERE ip = "' . Funcs::getIP() . '"'; } else { $query = 'INSERT INTO ' . $table . ' (ip,code,datetime) VALUES ("' . Funcs::getIP() . '","' . $code . '","' . Funcs::getDatetime() . '")'; } MyPDO::get()->query($query); }
public static function getDatetime() { echo Funcs::getDatetime(); }