From 3cf94aae0e144c461841da09d13a36c43884ddd8 Mon Sep 17 00:00:00 2001 From: Darshan Gada Date: Sat, 2 Sep 2023 21:25:46 +0530 Subject: [PATCH] fix: export script --- scripts/export.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/export.php b/scripts/export.php index d1fb5b40f..ec644898e 100644 --- a/scripts/export.php +++ b/scripts/export.php @@ -1,6 +1,7 @@ num_rows > 0) { while($row = $result->fetch_assoc()) { // Pushing it into Fresh Array - $regionsArray[$m]['id'] = (int)$row['id']; - $regionsArray[$m]['name'] = $row['name']; - $regionsArray[$m]['translations'] = json_decode($row['translations'], true); + $regionsArray[$r]['id'] = (int)$row['id']; + $regionsArray[$r]['name'] = $row['name']; + $regionsArray[$r]['translations'] = json_decode($row['translations'], true); - $m++; + $r++; } } +echo 'Total Regions Count : '.count($regionsArray).PHP_EOL; echo 'Total Countries Count : '.count($countriesArray).PHP_EOL; echo 'Total States Count : '.count($statesArray).PHP_EOL; echo 'Total Cities Count : '.count($citiesArray).PHP_EOL; -echo 'Total Regions Count : '.count($regionsArray).PHP_EOL; // print_r($countriesArray); $exportTo = $rootDir . '/countries.json';