diff options
author | kitlo | 2018-05-13 14:06:37 +0000 |
---|---|---|
committer | kitlo | 2018-05-13 14:06:37 +0000 |
commit | df467f01bcd93c7f30584a86ea41a522e39804bd (patch) | |
tree | fb375acfb0dd83683166ef92c6dd20e069fb1890 | |
parent | 73653f8db9e090f4d65bb5f578032d13e3526d4f (diff) | |
download | server-df467f01bcd93c7f30584a86ea41a522e39804bd.tar.gz server-df467f01bcd93c7f30584a86ea41a522e39804bd.tar.xz server-df467f01bcd93c7f30584a86ea41a522e39804bd.zip |
mysql_connect() deprecatedR_0_201805131000
Change-Id: I3f98bf077a231791fc12ceb701f5abcfe15065c0
-rw-r--r-- | classes/export/syncup.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/classes/export/syncup.php b/classes/export/syncup.php index 8aba72d..400cc22 100644 --- a/classes/export/syncup.php +++ b/classes/export/syncup.php @@ -34,10 +34,6 @@ if( !function_exists('json_encode') ){ $User = getSyncupUser(); -// $dbc = new DBConnection(); -// global $dbh; -// $dbh = $dbc->connect(); - echo "Connection established. Ready to begin. The syncup user id is: $User->userid\n"; /** @@ -84,8 +80,14 @@ while( ($language_row = mysqli_fetch_assoc($language_result)) != null ) { $language_iso = $language_row['iso_code']; $language_id = $language_row['language_id']; echo "\nInvestigating $language_name ($language_iso) (language_id=$language_id)\n"; - #In performance purpose, the SQL sorts a temporary table, TEMP. - $untranslated_strings = mysqli_query($dbh, "SELECT * FROM (SELECT string_id, value from strings where is_active and non_translatable = 0 and value <> '' and string_id not in(select string_id from translations where language_id=$language_id) ) AS TEMP order by value" ); + #For performance purpose, the SQL sorts a temporary table, TEMP. + $sql = "SELECT * FROM (SELECT string_id, value from strings where is_active and non_translatable = 0 and value <> '' and string_id not in(select string_id from translations where language_id=$language_id) ) AS TEMP order by value"; + $untranslated_strings = mysqli_query($dbh, $sql); + if($untranslated_strings === FALSE) { + # We may have lost the database connection with our shell-outs, reconnect + $dbh = $dbc->connect(); + $untranslated_strings = mysqli_query($dbh, $sql); + } $count = 0; $prev_value = ''; while ( ($string_row = mysqli_fetch_assoc($untranslated_strings)) != null) { |