multi_query warning 나는 문제 해결
This commit is contained in:
@@ -124,7 +124,14 @@ $rootDB->error_handler = 'dbSQLFail';
|
|||||||
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
|
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))){
|
||||||
while (@$mysqli_obj->next_result()) {;}
|
while(true){
|
||||||
|
if (!$mysqli_obj->more_results()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!$mysqli_obj->next_result()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootDB->insert('system', array(
|
$rootDB->insert('system', array(
|
||||||
|
|||||||
+7
-13
@@ -207,26 +207,20 @@ function SetNationFront($nationNo) {
|
|||||||
$adj = [];
|
$adj = [];
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$warNations = $db->queryFirstColumn(
|
$enemyCities = $db->queryFirstColumn(
|
||||||
'SELECT you from diplomacy where me = %i and (state=0 or (state=1 and term<=3))'
|
'SELECT city from city where nation IN
|
||||||
|
(SELECT you from diplomacy where me = %i and (state=0 or (state=1 and term<=3)))'
|
||||||
, $nationNo
|
, $nationNo
|
||||||
);
|
);
|
||||||
if($warNations) {
|
if($enemyCities) {
|
||||||
foreach($warNations as $warNation){
|
foreach($enemyCities as $city){
|
||||||
$enemyCities = $db->queryFirstColumn('SELECT city from city where nation=%i', $warNation);
|
$adj = array_merge($adj, CityConst::byID($city)->path);
|
||||||
foreach($enemyCities as $city){
|
|
||||||
foreach(CityConst::byID($city)->path as $adjCity){
|
|
||||||
$adj[$adjCity] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//평시이면 공백지
|
//평시이면 공백지
|
||||||
//NOTE: if, else일 경우 NPC는 전쟁시에는 공백지로 출병하지 않는다는 뜻이 된다.
|
//NOTE: if, else일 경우 NPC는 전쟁시에는 공백지로 출병하지 않는다는 뜻이 된다.
|
||||||
foreach ($db->queryFirstColumn('SELECT city,path from city where nation=0') as $city) {
|
foreach ($db->queryFirstColumn('SELECT city,path from city where nation=0') as $city) {
|
||||||
foreach(CityConst::byID($city)->path as $adjCity){
|
$adj = array_merge($adj, CityConst::byID($city)->path);
|
||||||
$adj[$adjCity] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-2
@@ -63,11 +63,26 @@ $scenarioObj = new Scenario($scenario);
|
|||||||
$startyear = $scenarioObj->getYear();
|
$startyear = $scenarioObj->getYear();
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
||||||
while (@$mysqli_obj->next_result()) {;}
|
while(true){
|
||||||
|
if (!$mysqli_obj->more_results()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!$mysqli_obj->next_result()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/schema.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/schema.sql'))){
|
||||||
while (@$mysqli_obj->next_result()) {;}
|
while(true){
|
||||||
|
if (!$mysqli_obj->more_results()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!$mysqli_obj->next_result()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,14 @@ if($fullReset && class_exists('\\sammo\\DB')){
|
|||||||
$mysqli_obj = DB::db()->get();
|
$mysqli_obj = DB::db()->get();
|
||||||
|
|
||||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
||||||
while (@$mysqli_obj->next_result()) {;}
|
while(true){
|
||||||
|
if (!$mysqli_obj->more_results()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!$mysqli_obj->next_result()){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user