<?php header("Cache-Control: no-cache, must-revalidate"); include_once '../DB.class.php'; // 查询用户名是否存在 $username = $_GET['username']; $db = new DB(); $query = "select * from admin where username='******'"; $result = $db->selectOne($query); //$count = $result->num_rows; $count = mysqli_num_rows($result); mysqli::close(); if ($count > 0) { echo 1; // 存在 } else { echo 0; // 不存在 }
public function treeReorderRows($args = []) { if (!empty($args['reorder'])) { foreach ($args['reorder'] as $id => $priority) { \DB::table($this->getTable())->where('id', $id)->update([$this->treeOrderColumn() => $priority]); } $row = \DB::selectOne('select ' . $this->getKeyName() . ', ' . $this->treePidColumn() . ' from ' . $this->getTable() . ' where ' . $this->getKeyName() . '=? order by ' . $this->treeOrderColumn(), [$id]); $this->treeReorderLevel($row[$this->treePidColumn()]); } }
Route::get('doctors/{id}', 'DoctorController@show'); /** * Specialties * */ Route::get('specialties', 'SpecialtyController@index'); /** * Locations * */ Route::get('locations', 'LocationController@index'); Route::get('locations/search', 'LocationController@search'); Route::get('locations/{location}', 'LocationController@show'); }); Route::get('locations/try-this-one', 'LocationController@tryThisOne'); //Route::get('refresh/', 'RefreshController@refresh'); Route::get('test/escape', function () { $results = DB::selectOne(DB::raw("select *\n from temp_locations\n where address_1 = :address\n and City = :city"), array('address' => "901 St Mary's Dr #200", 'city' => "Evansville")); dd($results); }); Route::get('test/mssql/{id}', function ($id) { $user = env('MSSQL_USERNAME'); $password = env('MSSQL_PASSWORD'); $db = new PDO('dblib:host=sql05-1.aoanet.local;dbname=imis', $user, $password); $q = "select * from imis.dbo.vfindyourdo where id = {$id}"; //$stmt = $db->query($q); $stmt = $db->prepare($q); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $current = App\Physician::where('aoa_mem_id', '=', (int) $row['id'])->first(); });