Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 457686 Details for
Bug 603988
app-text/refbase-0.9.6 Version bump request
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
refbase-0.9.6-mysqli.patch
refbase-0.9.6-mysqli.patch (text/plain), 96.77 KB, created by
Brian Evans (RETIRED)
on 2016-12-29 02:40:18 UTC
(
hide
)
Description:
refbase-0.9.6-mysqli.patch
Filename:
MIME Type:
Creator:
Brian Evans (RETIRED)
Created:
2016-12-29 02:40:18 UTC
Size:
96.77 KB
patch
obsolete
>diff -aurwN a/cite/formats/cite_ascii.php b/cite/formats/cite_ascii.php >--- a/cite/formats/cite_ascii.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/cite/formats/cite_ascii.php 2016-12-26 21:06:25.020743437 -0500 >@@ -94,7 +94,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > foreach ($row as $rowFieldName => $rowFieldValue) > // Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$plainTextSearchReplaceActionsArray': >diff -aurwN a/cite/formats/cite_html.php b/cite/formats/cite_html.php >--- a/cite/formats/cite_html.php 2012-02-28 18:05:42.000000000 -0500 >+++ b/cite/formats/cite_html.php 2016-12-26 21:06:25.020743437 -0500 >@@ -113,7 +113,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > $encodedRowData = $row; // we keep '$row' in its original (unencoded) form since unencoded data will be required by function 'linkifyFieldItems()' below > >diff -aurwN a/cite/formats/cite_latex.php b/cite/formats/cite_latex.php >--- a/cite/formats/cite_latex.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/cite/formats/cite_latex.php 2016-12-26 21:06:25.021743424 -0500 >@@ -130,7 +130,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > foreach ($row as $rowFieldName => $rowFieldValue) > // Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$latexSearchReplaceActionsArray': >diff -aurwN a/cite/formats/cite_latex_bbl.php b/cite/formats/cite_latex_bbl.php >--- a/cite/formats/cite_latex_bbl.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/cite/formats/cite_latex_bbl.php 2016-12-26 21:06:25.021743424 -0500 >@@ -182,7 +182,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > foreach ($row as $rowFieldName => $rowFieldValue) > // Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$latexSearchReplaceActionsArray': >diff -aurwN a/cite/formats/cite_markdown.php b/cite/formats/cite_markdown.php >--- a/cite/formats/cite_markdown.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/cite/formats/cite_markdown.php 2016-12-26 21:06:25.021743424 -0500 >@@ -92,7 +92,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > foreach ($row as $rowFieldName => $rowFieldValue) > // Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$markdownSearchReplaceActionsArray': >diff -aurwN a/cite/formats/cite_pdf.php b/cite/formats/cite_pdf.php >--- a/cite/formats/cite_pdf.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/cite/formats/cite_pdf.php 2016-12-26 21:06:25.021743424 -0500 >@@ -181,7 +181,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > foreach ($row as $rowFieldName => $rowFieldValue) > // Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$pdfSearchReplaceActionsArray': >diff -aurwN a/cite/formats/cite_rtf.php b/cite/formats/cite_rtf.php >--- a/cite/formats/cite_rtf.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/cite/formats/cite_rtf.php 2016-12-26 21:06:25.022743412 -0500 >@@ -113,7 +113,7 @@ > // LOOP OVER EACH RECORD: > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > foreach ($row as $rowFieldName => $rowFieldValue) > // Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$rtfSearchReplaceActionsArray': >diff -aurwN a/contrib/mediawiki/refbase.php b/contrib/mediawiki/refbase.php >--- a/contrib/mediawiki/refbase.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/contrib/mediawiki/refbase.php 2016-12-26 21:23:59.421701016 -0500 >@@ -81,18 +81,17 @@ > "/ +- +/" => " – " > ); > >- $link = mysql_connect($hostName, $username, $password); >+ $link = new mysqli($hostName, $username, $password, $databaseName); > if (! $link) > die("Couldn't connect to MySQL"); >- mysql_select_db($databaseName, $link) or die("Couldn't open $db: ".mysql_error()); > > //select the new updated values >- $result = mysql_query( "SELECT type, author, title, year, publication, volume, issue, pages, publisher, place, language, issn, doi FROM $tableRefs where serial=$input" ) >- or die("SELECT Error: ".mysql_error()); >+ $result = $link->query( "SELECT type, author, title, year, publication, volume, issue, pages, publisher, place, language, issn, doi FROM $tableRefs where serial=$input" ) >+ or die("SELECT Error: ".$link->error); > > $cite = ""; > >- while ($row = mysql_fetch_array($result)) { >+ while ($row = $result->fetch_array()) { > if ($row["type"]=="Journal Article"){ > $cite .= "{{cite_journal|url=$databaseBaseURL"."show.php?record=$input|"; > if(!empty($row["author"])){ >diff -aurwN a/duplicate_modify.php b/duplicate_modify.php >--- a/duplicate_modify.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/duplicate_modify.php 2016-12-26 21:13:25.231547536 -0500 >@@ -158,7 +158,7 @@ > foreach($queryArray as $query) > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- $affectedRows = ($result ? mysql_affected_rows ($connection) : 0); // get the number of rows that were modified (or return 0 if an error occurred) >+ $affectedRows = ($result ? $connection->affected_rows : 0); // get the number of rows that were modified (or return 0 if an error occurred) > > if ($affectedRows == 0) // no rows were affected by the update > { >diff -aurwN a/includes/atomxml.inc.php b/includes/atomxml.inc.php >--- a/includes/atomxml.inc.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/includes/atomxml.inc.php 2016-12-26 21:07:49.847694554 -0500 >@@ -295,7 +295,7 @@ > $exportArray = array(); // array for individually exported records > > // Generate the export for each record and push them onto an array: >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > // Export the current record as Atom XML entry: > $entry = atomEntry($row, $markupPatternsArray); >diff -aurwN a/includes/include.inc.php b/includes/include.inc.php >--- a/includes/include.inc.php 2013-04-16 06:37:01.000000000 -0400 >+++ b/includes/include.inc.php 2016-12-26 21:07:49.863694355 -0500 >@@ -224,8 +224,8 @@ > { > // (1) OPEN the database connection: > // (variables are set by include file 'db.inc.php'!) >- if (!($connection = @ mysql_connect($hostName, $username, $password))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($connection = @ new mysqli($hostName, $username, $password, $databaseName))) >+ if (mysqli_connect_error()) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( > showErrorMsg("The following error occurred while trying to connect to the host:"); > > // Get the MySQL version and save it to a session variable: >@@ -242,12 +242,6 @@ > else > queryMySQLDatabase("SET NAMES latin1"); // by default, we establish a 'latin1' connection > } >- >- // (3) SELECT the database: >- // (variables are set by include file 'db.inc.php'!) >- if (!(mysql_select_db($databaseName, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >- showErrorMsg("The following error occurred while trying to connect to the database:"); > } > } > >@@ -262,8 +256,7 @@ > global $client; > > // (3) RUN the query on the database through the connection: >- if (!($result = @ mysql_query($query, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($result = @ $connection->query($query))) > { > if (isset($client) AND preg_match("/^cli/i", $client)) // if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0") > // note that we also HTML encode the query for CLI clients since a malicious user could use the client parameter to perform a cross-site scripting (XSS) attack >@@ -285,8 +278,7 @@ > > if (isset($connection)) > // (5) CLOSE the database connection: >- if (!(mysql_close($connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($connection->close())) > showErrorMsg("The following error occurred while trying to disconnect from the database:"); > } > >@@ -301,7 +293,7 @@ > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection > >- $row = mysql_fetch_row($result); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) >+ $row = $result->fetch_row(); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) > $mysqlVersionString = $row[0]; // extract the contents of the first (and only) row (returned version string will be something like "4.0.20-standard" etc.) > $mysqlVersion = preg_replace("/^(\d+\.\d+).+/", "\\1", $mysqlVersionString); // extract main version number (e.g. "4.0") from version string > >@@ -313,13 +305,13 @@ > // Get MySQL field info: > // (i.e. fetch field (column) information from a given result resource; returns the > // field property given in '$propertyName', else an array of all field properties; >- // see <http://www.php.net/mysql_fetch_field>) >+ // see <http://www.php.net/mysqli_fetch_field>) > function getMySQLFieldInfo($result, $fieldOffset, $propertyName = "") > { > $fieldInfoArray = array(); > > // Get field (column) metadata: >- $fieldInfo = mysql_fetch_field($result, (int)$fieldOffset); // returns an object containing the field information >+ $fieldInfo = $result->fetch_field_direct((int)$fieldOffset); // returns an object containing the field information > > // Copy object properties to an array: > $fieldInfoArray["name"] = $fieldInfo->name; // column name >@@ -351,7 +343,7 @@ > function seekInMySQLResultsToOffset($result, $rowOffset, $showRows, $displayType, $citeType) > { > // Find out how many rows are available: >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { > // ... setup variables in order to facilitate "previous" & "next" browsing: >@@ -396,7 +388,7 @@ > $nextOffset = $rowOffset + $showRows; > > // d) Seek to the current offset >- mysql_data_seek($result, $rowOffset); // move internal result pointer to the row number given in '$rowOffset' >+ $result->data_seek($rowOffset); // move internal result pointer to the row number given in '$rowOffset' > } > else // set variables to zero in order to prevent 'Undefined variable...' messages when nothing was found ('$rowsFound = 0'): > { >@@ -421,9 +413,10 @@ > function showErrorMsg($headerMsg) > { > global $client; >+ global $connection; > >- $errorNo = mysql_errno(); >- $errorMsg = mysql_error(); >+ $errorNo = mysqli_connect_errno(); >+ $errorMsg = mysqli_connect_error(); > > if (preg_match("/^cli/i", $client)) // if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0") > // note that we also HTML encode the '$errorMsg' for CLI clients since a malicious user could use the client parameter to perform a cross-site scripting (XSS) attack >@@ -631,7 +624,7 @@ > $query = "SELECT user_id FROM $tableAuth WHERE email = " . quote_smart($emailAddress); > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > return($row["user_id"]); > } >@@ -944,7 +937,7 @@ > $result = queryMySQLDatabase($queryRefs); > > // Get the record id that was created: >- $serialNo = @ mysql_insert_id($connection); // find out the unique ID number of the newly created record (Note: this function should be called immediately after the >+ $serialNo = @ $connection->insert_id; // find out the unique ID number of the newly created record (Note: this function should be called immediately after the > // SQL INSERT statement! After any subsequent query it won't be possible to retrieve the auto_increment identifier value for THIS record!) > > // ADD USER DATA: >@@ -3736,10 +3729,10 @@ > > $foundSerialsArray = array(); // initialize array variable (which will hold the serial numbers of all found records) > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > { > $recordID = $row["record_id"]; // get the serial number of the current record > $foundSerialsArray[] = $recordID; // add this record's serial to the array of found serial numbers >@@ -3835,10 +3828,10 @@ > > $userGroupsArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > { > // remove any meaningless delimiter(s) from the beginning or end of a field string: > $rowUserGroupsString = trimTextPattern($row["user_groups"], "( *; *)+", true, true); >@@ -3893,10 +3886,10 @@ > > $userQueriesArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > $userQueriesArray[] = $row["query_name"]; // append this row's query name to the array of found user queries > > // join array of unique user queries with '; ' as separator: >@@ -3928,10 +3921,10 @@ > > $userCiteKeysArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > { > // If this row's cite key already exists in the global array of found cite keys ('$citeKeysArray'), > // we'll uniquify it, otherwise we'll take it as is >@@ -4005,9 +3998,9 @@ > > $availableFormatsStylesTypesArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > $availableFormatsStylesTypesArray[$row[$dataType . "_id"]] = $row[$dataType . "_name"]; // append this row's format/style/type name to the array of found user formats/styles/types > > return $availableFormatsStylesTypesArray; >@@ -4036,9 +4029,9 @@ > > $enabledFormatsStylesTypesArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > { > if ($returnIDsAsValues) // return format/style/type IDs as element values: > $enabledFormatsStylesTypesArray[] = $row[$dataType . "_id"]; // append this row's format/style/type ID to the array of found user formats/styles/types >@@ -4101,10 +4094,10 @@ > else > $sessionVariableName = "user_" . $dataType . "s"; // yields 'user_styles' or 'user_types' > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > $userFormatsStylesTypesArray[] = $row[$dataType . "_name"]; // append this row's format/style/type name to the array of found user formats/styles/types > > // we'll only update the appropriate session variable if either a normal user is logged in -OR- the admin is logged in and views his own user options page >@@ -4182,7 +4175,7 @@ > $query = "SELECT style_spec FROM $tableStyles WHERE style_name = " . quote_smart($citeStyle); > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > return($row["style_spec"]); > } >@@ -4201,7 +4194,7 @@ > $query = "SELECT format_spec FROM $tableFormats WHERE format_name = " . quote_smart($formatName) . " AND format_type = " . quote_smart($formatType); > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > return($row["format_spec"]); > } >@@ -4220,7 +4213,7 @@ > $query = "SELECT depends_path FROM $tableDepends WHERE depends_external = " . quote_smart($externalUtilityName); > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > return($row["depends_path"]); > } >@@ -4249,14 +4242,14 @@ > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection > >- if (mysql_num_rows($result) == 1) // interpret query result: Do we have exactly one row? >+ if ($result->num_rows == 1) // interpret query result: Do we have exactly one row? > { > $userPermissionsArray = array(); // initialize array variables > $userPermissionsFieldNameArray = array(); > >- $row = mysql_fetch_array($result); // fetch the one row into the array '$row' >+ $row = $result->fetch_array(); // fetch the one row into the array '$row' > >- $fieldsFound = mysql_num_fields($result); // count the number of fields >+ $fieldsFound = $result->field_count; // count the number of fields > > for ($i=0; $i<$fieldsFound; $i++) > { >@@ -4314,10 +4307,10 @@ > > $languagesArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > $languagesArray[] = $row["language_name"]; // append this row's language name to the array of found languages > } > >@@ -4366,9 +4359,9 @@ > > $userOptionsArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound == 1) // Interpret query result: Do we have exactly one row? >- $userOptionsArray = @ mysql_fetch_array($result); // fetch the one row into the array '$userOptionsArray' >+ $userOptionsArray = @ $result->fetch_array(); // fetch the one row into the array '$userOptionsArray' > > return $userOptionsArray; > } >@@ -4495,7 +4488,7 @@ > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection > >- $row = mysql_fetch_row($result); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) >+ $row = $result->fetch_row(); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) > $numberOfRecords = $row[0]; // extract the contents of the first (and only) row > > return $numberOfRecords; >@@ -4586,7 +4579,7 @@ > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection > >- $row = mysql_fetch_row($result); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) >+ $row = $result->fetch_row(); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) > $lastModifiedDateTime = $row[0] . " " . $row[1]; > > return $lastModifiedDateTime; >@@ -4974,7 +4967,7 @@ > $i = 0; > $resultBuffer = array(); > >- while ($row = @ mysql_fetch_array($resultId)) >+ while ($row = @ $result->fetch_array(Id)) > { > if ($SplitValues) // if desired, split field contents into substrings > { >@@ -5089,10 +5082,10 @@ > > $fieldContentsArray = array(); // initialize array variable > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { >- while ($row = @ mysql_fetch_array($result)) // for all rows found >+ while ($row = @ $result->fetch_array()) // for all rows found > $fieldContentsArray[] = $row[$columnName]; // append this row's field value to the array of extracted field values > } > >@@ -6028,13 +6021,18 @@ > > // -------------------------------------------------------------------- > >- // this function uses 'mysql_real_escape_string()' to: >+ // this function uses 'mysqli_real_escape_string()' to: > // - prepend backslashes to \, ', " > // - replace the characters \x00, \n, \r, and \x1a with a MySQL acceptable representation > // for queries (e.g., the newline character is replaced with the litteral string '\n') > function escapeSQL($sourceString) > { >- $sourceString = mysql_real_escape_string($sourceString); >+ global $connection; >+ >+ if (!$connection) >+ connectToMySQLDatabase(); >+ >+ $sourceString = $connection->real_escape_string($sourceString); > > return $sourceString; > } >@@ -6408,7 +6406,7 @@ > . "\n\t\t</image>"; > > // fetch results: upto the limit specified in '$showRows', fetch a row into the '$row' array and write out a RSS item: >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > $origTitle = $row['title']; // save the original title contents before applying any search & replace actions > >@@ -6494,7 +6492,7 @@ > $fieldValuesArray = array(); // initialize array variable which will hold the splitted sub-items > > // split field values on the given delimiter: >- for ($i=0; $row = @ mysql_fetch_array($result); $i++) >+ for ($i=0; $row = @ $result->fetch_array(); $i++) > { > $fieldSubValuesArray = preg_split($delim, $row[$fieldName]); // split field contents on '$delim' (which is interpreted as perl-style regular expression!) > foreach ($fieldSubValuesArray as $fieldSubValue) >diff -aurwN a/includes/install.inc.php b/includes/install.inc.php >--- a/includes/install.inc.php 2008-04-15 07:31:50.000000000 -0400 >+++ b/includes/install.inc.php 2016-12-26 21:22:15.745984004 -0500 >@@ -64,15 +64,8 @@ > global $connection; > > // Establish a *new* connection that has admin permissions >- // (1) OPEN the database connection: >- if (!($connection = @ mysql_connect($hostName, $adminUserName, $adminPassword))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($connection = @ new mysqli($hostName, $adminUserName, $adminPassword, $databaseName))) > showErrorMsg("The following error occurred while trying to connect to the host:", ""); >- >- // (2) SELECT the database: >- if (!(mysql_select_db($databaseName, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >- showErrorMsg("The following error occurred while trying to connect to the database:", ""); > } > > // -------------------------------------------------------------------- >@@ -104,7 +97,7 @@ > > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound == 0) > { > $query = "INSERT INTO " . $table . " VALUES " . $values; >@@ -133,7 +126,7 @@ > $queryFields = "SHOW FIELDS FROM " . $table; > $result = queryMySQLDatabase($queryFields); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- while ($row = @ mysql_fetch_array($result)) // for all fields found, check if any of their names matches the field name that we want to add >+ while ($row = @ $result->fetch_array()) // for all fields found, check if any of their names matches the field name that we want to add > if ($row["Field"] == $column) > $present = true; > >@@ -165,7 +158,7 @@ > $queryFields = "SHOW TABLES"; > $result = queryMySQLDatabase($queryFields); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- while ($row = @ mysql_fetch_array($result)) // for all tables found, check if any of their names matches the table name that we want to add >+ while ($row = @ $result->fetch_array()) // for all tables found, check if any of their names matches the table name that we want to add > if ($row[0] == $table) > $present = true; > >diff -aurwN a/includes/modsxml.inc.php b/includes/modsxml.inc.php >--- a/includes/modsxml.inc.php 2012-02-28 18:56:52.000000000 -0500 >+++ b/includes/modsxml.inc.php 2016-12-26 21:07:49.865694331 -0500 >@@ -198,7 +198,7 @@ > ); > > // Generate the export for each record and push them onto an array: >- while ($row = @ mysql_fetch_array($result)) { >+ while ($row = @ $result->fetch_array()) { > // Export the current record as MODS XML > $record = modsRecord($row); > >diff -aurwN a/includes/oaidcxml.inc.php b/includes/oaidcxml.inc.php >--- a/includes/oaidcxml.inc.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/includes/oaidcxml.inc.php 2016-12-26 21:07:49.865694331 -0500 >@@ -69,7 +69,7 @@ > $citeKeysArray = array(); // array of cite keys (used to ensure uniqueness of cite keys among all exported records) > > // Generate the export for each record and push them onto an array: >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > { > // Export the current record as OAI_DC XML: > $record = oaidcRecord($row, "oai_dc"); >diff -aurwN a/includes/odfxml.inc.php b/includes/odfxml.inc.php >--- a/includes/odfxml.inc.php 2008-08-19 16:00:40.000000000 -0400 >+++ b/includes/odfxml.inc.php 2016-12-26 21:07:49.866694318 -0500 >@@ -155,7 +155,7 @@ > list($universalSearchReplaceActionsArray, $fieldSpecificSearchReplaceActionsArray, $odfIndexesToRefbaseFieldsArray, $referenceTypesToRefbaseTypesArray) = initializeArrays(); > > // Generate the export for each record and push them onto an array: >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > { > // Parse the current record into an array of field data that shall be exported to ODF: > $recordExportArray = parseRecord($row, $odfIndexesToRefbaseFieldsArray, $referenceTypesToRefbaseTypesArray, $universalSearchReplaceActionsArray, $fieldSpecificSearchReplaceActionsArray); >diff -aurwN a/includes/srwxml.inc.php b/includes/srwxml.inc.php >--- a/includes/srwxml.inc.php 2013-09-27 17:45:07.000000000 -0400 >+++ b/includes/srwxml.inc.php 2016-12-26 21:07:49.868694293 -0500 >@@ -86,7 +86,7 @@ > $exportArray = array(); // Array for individually exported records > > // Generate the export for each record and push them onto an array: >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > if (preg_match("/DC/i", $exportFormat)) // export the current record as DC XML (i.e. simple Dublin Core): > $record = oaidcRecord($row, "srw_dc"); // function 'oaidcRecord()' is defined in 'oaidcxml.inc.php' >diff -aurwN a/install.php b/install.php >--- a/install.php 2012-02-28 19:30:18.000000000 -0500 >+++ b/install.php 2016-12-26 21:20:59.057933019 -0500 >@@ -380,14 +380,9 @@ > // If we made it here, then the data is considered valid! > > // (1) Open the database connection and use the mysql database: >- if (!($connection = @ mysql_connect($hostName,$adminUserName,$adminPassword))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($connection = @ new mysqli($hostName,$adminUserName,$adminPassword,$adminDatabaseName))) > showErrorMsg("The following error occurred while trying to connect to the host:", ""); > >- if (!(mysql_select_db($adminDatabaseName, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >- showErrorMsg("The following error occurred while trying to connect to the database:", ""); >- > > // First, check if we're a dealing with MySQL version 4.1.x or greater: > // (MySQL 4.1.x is required if the refbase MySQL database/tables shall be installed using Unicode/UTF-8 as default character set) >@@ -417,12 +412,10 @@ > $queryUpdateDependsTable = "UPDATE " . $databaseName . "." . $tableDepends . " SET depends_enabled = \"false\" WHERE depends_external = \"bibutils\""; // disable Bibutils functionality > > // (2) Run the INSTALL queries on the mysql database through the connection: >- if (!($result = @ mysql_query ($queryGrantStatement, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($result = @ $connection->query ($queryGrantStatement))) > showErrorMsg("The following error occurred while trying to query the database:", ""); > >- if (!($result = @ mysql_query ($queryCreateDB, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($result = @ $connection->query ($queryCreateDB))) > showErrorMsg("The following error occurred while trying to query the database:", ""); > > // IMPORT the literature database structure from file: >@@ -436,13 +429,11 @@ > // stderr to stdout, which you can then easily print using something like print `shellcommand 2>&1`. > > // run the UPDATE query on the depends table of the (just imported) literature database: >- if (!($result = @ mysql_query ($queryUpdateDependsTable, $connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($result = @ $connection->query ($queryUpdateDependsTable))) > showErrorMsg("The following error occurred while trying to query the database:", ""); > > // (5) Close the database connection: >- if (!(mysql_close($connection))) >- if (mysql_errno() != 0) // this works around a stupid(?) behaviour of the Roxen webserver that returns 'errno: 0' on success! ?:-( >+ if (!($connection->close())) > showErrorMsg("The following error occurred while trying to disconnect from the database:", ""); > > $resultLines = ""; // initialize variable >diff -aurwN a/modify.php b/modify.php >--- a/modify.php 2013-04-16 17:23:55.000000000 -0400 >+++ b/modify.php 2016-12-26 21:13:25.244547375 -0500 >@@ -448,7 +448,7 @@ > $queryFile = "SELECT file FROM $tableRefs WHERE serial = " . quote_smart($serialNo); > > $result = queryMySQLDatabase($queryFile); // RUN the query on the database through the connection >- $row = @ mysql_fetch_array($result); >+ $row = @ $result->fetch_array(); > > $fileName = $row["file"]; > } >@@ -947,7 +947,7 @@ > // (3) RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- if (mysql_num_rows($result) == 1) // if there's already an existing user_data entry, we perform an UPDATE action: >+ if ($result->num_rows == 1) // if there's already an existing user_data entry, we perform an UPDATE action: > $queryUserData = "UPDATE $tableUserData SET " > . "marked = " . quote_smart($markedRadio) . ", " > . "copy = " . quote_smart($copyName) . ", " >@@ -1134,7 +1134,7 @@ > $result = queryMySQLDatabase($queryRefs); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > > // Get the record id that was created >- $serialNo = @ mysql_insert_id($connection); // find out the unique ID number of the newly created record (Note: this function should be called immediately after the >+ $serialNo = @ $connection->insert_id; // find out the unique ID number of the newly created record (Note: this function should be called immediately after the > // SQL INSERT statement! After any subsequent query it won't be possible to retrieve the auto_increment identifier value for THIS record!) > > $formVars['serialNo'] = $serialNo; // for '$recordAction = "add"' we update the original '$formVars' array element to ensure a correct serial number when generating the file name via the 'parsePlaceholderString()' function >diff -aurwN a/queries.php b/queries.php >--- a/queries.php 2008-08-19 12:57:47.000000000 -0400 >+++ b/queries.php 2016-12-26 21:13:25.246547351 -0500 >@@ -73,10 +73,10 @@ > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection (function 'queryMySQLDatabase()' is defined in 'include.inc.php') > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound == 1) // if there was exactly one row found (normally, this should be the case) ... > { >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > // redirect the browser to 'query_manager.php': > if (encodeHTML($submitAction) == $loc["ButtonTitle_Edit"]) // note that we need to HTML encode '$submitAction' for comparison with the HTML encoded locales (function 'encodeHTML()' is defined in 'include.inc.php') >diff -aurwN a/query_manager.php b/query_manager.php >--- a/query_manager.php 2012-02-28 19:44:26.000000000 -0500 >+++ b/query_manager.php 2016-12-26 21:13:25.248547326 -0500 >@@ -174,10 +174,10 @@ > // (3a) RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- if (@ mysql_num_rows($result) == 1) // this condition is added here to avoid the case that editing a query item which got deleted in the meantime invokes a seemingly correct but empty 'edit query' form >+ if (@ $result->num_rows == 1) // this condition is added here to avoid the case that editing a query item which got deleted in the meantime invokes a seemingly correct but empty 'edit query' form > { > // (3b) EXTRACT results: >- $row = mysql_fetch_array($result); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) >+ $row = $result->fetch_array(); // fetch the current row into the array $row (it'll be always *one* row, but anyhow) > > // check whether the user tries to edit a query that does not belong to his own set of saved queries: > if ($row['user_id'] != getUserID($loginEmail)) // the function 'getUserID' and the '$loginEmail' variable are specified in 'include.inc.php' >diff -aurwN a/query_modify.php b/query_modify.php >--- a/query_modify.php 2012-02-28 19:45:52.000000000 -0500 >+++ b/query_modify.php 2016-12-26 21:13:25.249547314 -0500 >@@ -176,7 +176,7 @@ > > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection (function 'queryMySQLDatabase()' is defined in 'include.inc.php') > >- if (@ mysql_num_rows($result) > 0) // if there's already a saved query (belonging to this user) with exactly the same name >+ if (@ $result->num_rows > 0) // if there's already a saved query (belonging to this user) with exactly the same name > $errors["queryName"] = "You've got already a query with that name!<br>Please choose a different name:"; // the user's query name must be unique (since the query popup of the 'Recall My Query' form on the main page uses the query's name to recall a particular query) > // note that we could allow for duplicate query names if the query popup on the main page would work with query IDs instead. However, from an interface design perspective, duplicate query names shouldn't be allowed anyhow. So we simply don't permit them. > } >@@ -261,7 +261,7 @@ > > if (preg_match("/^(edit|delet)$/", $queryAction)) > { >- $affectedRows = ($result ? mysql_affected_rows ($connection) : 0); // get the number of rows that were modified (or return 0 if an error occurred) >+ $affectedRows = ($result ? $connection->affected_rows : 0); // get the number of rows that were modified (or return 0 if an error occurred) > > if ($affectedRows == 0) // no rows were affected by the update, i.e., the query must have been deleted in the meantime! > // NOTE: Previously, we did return "Warning_SavedQueryDoesNotExistAnymore": "This saved query does not exist anymore". >@@ -283,7 +283,7 @@ > } > > elseif ($queryAction == "add") // Get the query id that was created: >- $queryID = @ mysql_insert_id($connection); // find out the unique ID number of the newly created query (Note: this function should be called immediately after the >+ $queryID = @ $connection->insert_id; // find out the unique ID number of the newly created query (Note: this function should be called immediately after the > // SQL INSERT statement! After any subsequent query it won't be possible to retrieve the auto_increment identifier value for THIS record!) > > // update the 'userQueries' session variable: >diff -aurwN a/record.php b/record.php >--- a/record.php 2013-11-19 13:28:06.000000000 -0500 >+++ b/record.php 2016-12-26 21:13:25.253547264 -0500 >@@ -305,10 +305,10 @@ > // (3a) RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- if (@ mysql_num_rows($result) == 1) // this condition is added here to avoid the case that clicking on a search result item which got deleted in the meantime invokes a seemingly correct but empty 'edit record' search form >+ if (@ $result->num_rows == 1) // this condition is added here to avoid the case that clicking on a search result item which got deleted in the meantime invokes a seemingly correct but empty 'edit record' search form > { > // (3b) EXTRACT results: >- $row = mysql_fetch_array($result); //fetch the current row into the array $row (it'll be always *one* row, but anyhow) >+ $row = $result->fetch_array(); //fetch the current row into the array $row (it'll be always *one* row, but anyhow) > > // fetch attributes of the current record into variables: > $authorName = encodeHTML($row['author']); >diff -aurwN a/rss.php b/rss.php >--- a/rss.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/rss.php 2016-12-26 21:13:25.253547264 -0500 >@@ -123,7 +123,7 @@ > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > > // find out how many rows are available: >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > > // construct a meaningful channel description based on the specified 'WHERE' clause: > $rssChannelDescription = "Displays all newly added records where " . explainSQLQuery($sanitizedWhereClause) . "."; // function 'explainSQLQuery()' is defined in 'include.inc.php' >diff -aurwN a/search.php b/search.php >--- a/search.php 2013-11-19 13:28:06.000000000 -0500 >+++ b/search.php 2016-12-26 21:13:25.267547091 -0500 >@@ -576,7 +576,7 @@ > if (($displayType == "Export")) > { > // Find out how many rows are available: >- $rowsFound = @ mysql_num_rows($result); // for all other display types, the '$rowsFound' variable is set within function 'seekInMySQLResultsToOffset()' (see below) >+ $rowsFound = @ $result->num_rows; // for all other display types, the '$rowsFound' variable is set within function 'seekInMySQLResultsToOffset()' (see below) > if ($rowsFound > 0) // If there were rows found ... > { > generateExport($result, $rowOffset, $showRows, $exportFormat, $exportType, $exportStylesheet, $displayType, $viewType, $userID); // export records using the export format specified in '$exportFormat' >@@ -609,7 +609,7 @@ > $queryURL = rawurlencode($query); // URL encode SQL query > > if (!preg_match("/^SELECT/i", $query)) // for queries other than SELECT queries (e.g. UPDATE, DELETE or INSERT queries that were executed by the admin via use of 'sql_search.php') >- $affectedRows = ($result ? mysql_affected_rows ($connection) : 0); // get the number of rows that were modified (or return 0 if an error occurred) >+ $affectedRows = ($result ? $connection->affected_rows : 0); // get the number of rows that were modified (or return 0 if an error occurred) > > // If the previous query (which is stored in the 'oldQuery' session variable) is different > // from the current query, we append it to the 'queryHistory' session variable: >@@ -893,7 +893,7 @@ > $CounterMax = 0; // Otherwise don't hide any columns > > // count the number of fields >- $fieldsFound = mysql_num_fields($result); >+ $fieldsFound = $result->field_count; > if ($displayType != "Browse") > { > // hide those last columns that were added by the script and not by the user >@@ -1059,7 +1059,7 @@ > // BEGIN RESULTS DATA COLUMNS -------------- > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > if (is_integer($rowCounter / 2)) // if we currently are at an even number of rows > $rowClass = "even"; >@@ -1276,7 +1276,7 @@ > $CounterMax = ($CounterMax + 1); // ...we'll also need to hide the 'related' column (which isn't displayed in Details view but is only used to generate a link to related records) > > // count the number of fields >- $fieldsFound = mysql_num_fields($result); >+ $fieldsFound = $result->field_count; > // hide those last columns that were added by the script and not by the user > $fieldsToDisplay = $fieldsFound-(2+$CounterMax+$addCounterMax); // (2+$CounterMax) -> $CounterMax is increased by 2 in order to hide the 'orig_record' & 'serial' columns (which were added to make checkboxes & dup warning work) > // $addCounterMax is set to 1 when the field given in '$fileVisibilityException[0]' (defined in 'ini.inc.php') was added to the query, otherwise '$addCounterMax = 0' >@@ -1436,7 +1436,7 @@ > // BEGIN RESULTS DATA COLUMNS -------------- > // Fetch one page of results (or less if on the last page) > // (i.e., upto the limit specified in $showRows) fetch a row into the $row array and ... >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > // ... print out each of the attributes > // in that row as a separate TR (Table Row) >@@ -2359,16 +2359,16 @@ > $recordSerialsArray = array(); > $duplicateRecordSerialsArray = array(); > >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > > // Identify any records with matching field data: > if ($rowsFound > 0) // if there were rows found ... > { > // Count the number of fields: >- $fieldsFound = mysql_num_fields($result); >+ $fieldsFound = $result->field_count; > > // Loop over each row in the result set: >- for ($rowCounter=0; $row = @ mysql_fetch_array($result); $rowCounter++) >+ for ($rowCounter=0; $row = @ $result->fetch_array(); $rowCounter++) > { > $recordIdentifier = ""; // make sure our buffer variable is empty > >@@ -5148,10 +5148,10 @@ > // Check whether the extracted serial numbers and cite keys exist in the database: > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection (function 'queryMySQLDatabase()' is defined in 'include.inc.php') > >- if (@ mysql_num_rows($result) > 0) // if there were rows found ... >+ if (@ $result->num_rows > 0) // if there were rows found ... > { > // Loop over each row in the result set: >- for ($rowCounter=0; $row = @ mysql_fetch_array($result); $rowCounter++) >+ for ($rowCounter=0; $row = @ $result->fetch_array(); $rowCounter++) > { > if (!in_array($row["serial"], $foundRecordSerialsKeysArray) OR (!empty($row["cite_key"]) AND !in_array($row["cite_key"], $foundRecordSerialsKeysArray))) // if this record identifier hasn't been seen yet > { >diff -aurwN a/sitemap.php b/sitemap.php >--- a/sitemap.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/sitemap.php 2016-12-26 21:13:25.270547054 -0500 >@@ -66,7 +66,7 @@ > // (3) RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { >+ while ($row = $result->fetch_array(, MYSQL_ASSOC)) { > echo " <url>\n"; > echo " <loc>".$databaseBaseURL."show.php?record=".$row['serial']."</loc>\n"; > if (!empty($row['modified_date'])) { >diff -aurwN a/update.php b/update.php >--- a/update.php 2013-09-27 17:45:07.000000000 -0400 >+++ b/update.php 2016-12-26 21:13:25.274547004 -0500 >@@ -250,20 +250,20 @@ > // TODO: create a new function 'changeColumn()' that only modifies the column spec if the new column spec is different from the old one > $query = "ALTER table " . $tableDeleted . " MODIFY edition varchar(50) default NULL"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); // get the number of rows that were modified (or return 0 if an error occurred) >+ $resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); // get the number of rows that were modified (or return 0 if an error occurred) > > $query = "ALTER table " . $tableDeleted . " MODIFY thesis enum('Bachelor''s thesis','Honours thesis','Master''s thesis','Ph.D. thesis','Diploma thesis','Doctoral thesis','Habilitation thesis') default NULL"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Alter table specification for table 'refs' > $query = "ALTER table " . $tableRefs . " MODIFY edition varchar(50) default NULL"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "ALTER table " . $tableRefs . " MODIFY thesis enum('Bachelor''s thesis','Honours thesis','Master''s thesis','Ph.D. thesis','Diploma thesis','Doctoral thesis','Habilitation thesis') default NULL"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Add field 'version' to table 'deleted' > $properties = "MEDIUMINT(8) UNSIGNED DEFAULT 1 AFTER modified_by"; >@@ -276,27 +276,27 @@ > // Update table 'refs' > $query = "UPDATE " . $tableRefs . " SET thesis = NULL WHERE thesis = ''"; // this fix is required to ensure correct sorting when outputting citations with '$citeOrder="type"' or '$citeOrder="type-year"' > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': updated 'thesis' field (replaced empty string with NULL). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': updated 'thesis' field (replaced empty string with NULL). Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableRefs . " SET type = 'Conference Article' WHERE type RLIKE '^(Unsupported: )?Conference Proceeding$'"; // this may not be perfect since some items of type "Conference Proceeding" may be actually a "Conference Volume" > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': updated 'type' field ('Conference Proceeding' => 'Conference Article'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': updated 'type' field ('Conference Proceeding' => 'Conference Article'). Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableRefs . " SET type = 'Miscellaneous' WHERE type RLIKE '^(Unsupported: )?Generic$'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': updated 'type' field ('Generic' => 'Miscellaneous'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': updated 'type' field ('Generic' => 'Miscellaneous'). Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableRefs . " SET type = 'Newspaper Article' WHERE type RLIKE '^(Unsupported: )?Newspaper$'"; // this may not be perfect since some items of type "Newspaper" may be actually a "Newspaper Volume" > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': updated 'type' field ('Newspaper' => 'Newspaper Article'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': updated 'type' field ('Newspaper' => 'Newspaper Article'). Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableRefs . " SET type = 'Software' WHERE type RLIKE '^(Unsupported: )?Computer Program$'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': updated 'type' field ('Computer Program' => 'Software'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': updated 'type' field ('Computer Program' => 'Software'). Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableRefs . " SET type = REPLACE(type,'Unsupported: ','') WHERE type RLIKE '^Unsupported: (Abstract|Conference (Article|Volume)|Magazine Article|Manual|Miscellaneous|Newspaper Article|Patent|Report|Software)$'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'refs': updated 'type' field (removed 'Unsupported' label for all newly supported types). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'refs': updated 'type' field (removed 'Unsupported' label for all newly supported types). Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Add new utilities to table 'depends' > $values = "(NULL, 'pdftotext', 'true', NULL)"; >@@ -329,10 +329,10 @@ > // First, check how many users are contained in table 'users': > $query = "SELECT user_id, first_name, last_name FROM " . $tableUsers; > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows (= user IDs) found ... > { >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > { > $values = "(NULL, " . $row['user_id'] . ", 'yes', 'yes', 'no', 'yes', '<:authors[2|+|++]:><:year:>', 'yes', 'transliterate', 'no', '<:authors[2| & | et al.]:>< :year:>< {:recordIdentifier:}>', NULL, 'author, title, publication, keywords, abstract')"; > $resultArray["Table 'user_options': inserted default options for user " . $row['user_id'] . " (" . $row['first_name'] . " " . $row['last_name'] . ")"] = insertIfNotExists(array("user_id" => $row['user_id']), $tableUserOptions, $values); >@@ -362,17 +362,17 @@ > // Disable the Browse view feature (which isn't done yet) for all users > $query= "UPDATE " . $tableUserPermissions . " SET allow_browse_view = 'no'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'user_permissions': disabled the Browse view feature (which isn't done yet). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'user_permissions': disabled the Browse view feature (which isn't done yet). Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Enable the Export feature for anyone who's not logged in ('$userID = 0'): > $query= "UPDATE " . $tableUserPermissions . " SET allow_export = 'yes', allow_batch_export = 'yes' WHERE user_id = 0"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'user_permissions': enabled the export feature for anyone who's not logged in. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'user_permissions': enabled the export feature for anyone who's not logged in. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Update table 'styles' > $query = "UPDATE " . $tableStyles . " SET style_spec = REPLACE(style_spec,'cite_','styles/cite_') WHERE style_spec RLIKE '^cite_'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'style_spec' field. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'style_spec' field. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $values = "(NULL, 'Ann Glaciol', 'true', 'styles/cite_AnnGlaciol_JGlaciol.php', 'B010', '1')"; > $resultArray["Table 'styles': inserted style 'Ann Glaciol'"] = insertIfNotExists(array("style_name" => "Ann Glaciol"), $tableStyles, $values); >@@ -406,96 +406,96 @@ > > $query = "UPDATE " . $tableStyles . " SET order_by = 'B010' WHERE style_name = 'Ann Glaciol'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'Ann Glaciol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'Ann Glaciol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableStyles . " SET order_by = 'B020' WHERE style_name = 'Deep Sea Res'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'Deep Sea Res' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'Deep Sea Res' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableStyles . " SET order_by = 'B030' WHERE style_name = 'J Glaciol'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'J Glaciol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'J Glaciol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableStyles . " SET order_by = 'B040' WHERE style_name = 'Mar Biol'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'Mar Biol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'Mar Biol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableStyles . " SET order_by = 'B050' WHERE style_name = 'MEPS'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'MEPS' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'MEPS' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableStyles . " SET order_by = 'B060' WHERE style_name = 'Polar Biol'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'Polar Biol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'Polar Biol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableStyles . " SET order_by = 'C010' WHERE style_name = 'Text Citation'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'styles': updated 'Text Citation' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'styles': updated 'Text Citation' style. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Update table 'types' > $query = "UPDATE " . $tableTypes . " SET order_by = '01' WHERE type_name = 'Journal Article'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Journal Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Journal Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '02' WHERE type_name = 'Abstract'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Abstract' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Abstract' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '03' WHERE type_name = 'Book Chapter'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Book Chapter' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Book Chapter' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '04' WHERE type_name = 'Book Whole'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Book Whole' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Book Whole' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '05' WHERE type_name = 'Conference Article'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Conference Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Conference Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '06' WHERE type_name = 'Conference Volume'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Conference Volume' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Conference Volume' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '07' WHERE type_name = 'Journal'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Journal' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Journal' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '08' WHERE type_name = 'Magazine Article'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Magazine Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Magazine Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '09' WHERE type_name = 'Manual'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Manual' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Manual' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '10' WHERE type_name = 'Manuscript'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Manuscript' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Manuscript' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '11' WHERE type_name = 'Map'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Map' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Map' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '12' WHERE type_name = 'Miscellaneous'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Miscellaneous' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Miscellaneous' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '13' WHERE type_name = 'Newspaper Article'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Newspaper Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Newspaper Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '14' WHERE type_name = 'Patent'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Patent' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Patent' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '15' WHERE type_name = 'Report'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Report' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Report' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableTypes . " SET order_by = '16' WHERE type_name = 'Software'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'types': updated 'Software' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'types': updated 'Software' type. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $values = "(NULL, 'Abstract', 'true', 2, '02')"; > $resultArray["Table 'types': inserted type 'Abstract'"] = insertIfNotExists(array("type_name" => "Abstract"), $tableTypes, $values); >@@ -546,78 +546,78 @@ > // Enable disabled localizations > $query = "UPDATE " . $tableLanguages . " SET language_enabled = 'true' WHERE language_name = 'de'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'languages': enabled German language option. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'languages': enabled German language option. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Alter table specification for table 'formats' > $query = "ALTER table " . $tableFormats . " MODIFY format_type enum('export','import','cite') NOT NULL default 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Update existing formats in table 'formats' > $query = "UPDATE " . $tableFormats . " SET format_name = 'BibTeX' WHERE format_name = 'Bibtex'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': renamed format name 'Bibtex' to 'BibTeX'. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': renamed format name 'Bibtex' to 'BibTeX'. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Update existing import formats in table 'formats' > $query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_bib2refbase.php', order_by = 'A010' WHERE format_name = 'BibTeX' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'BibTeX' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'BibTeX' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A020' WHERE format_name = 'Copac' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Copac' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Copac' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A030' WHERE format_name = 'CSA' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'CSA' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'CSA' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_end2refbase.php', order_by = 'A040' WHERE format_name = 'Endnote' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Endnote' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Endnote' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A045' WHERE format_name = 'Endnote XML' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Endnote XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Endnote XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_name = 'ISI', format_spec = 'import_isi2refbase.php', order_by = 'A050', depends_id = 1 WHERE (format_name = 'RIS (ISI)' OR format_name = 'ISI') AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'ISI' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'ISI' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A060' WHERE format_name = 'Pubmed Medline' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Pubmed Medline' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Pubmed Medline' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_med2refbase.php', order_by = 'A065' WHERE format_name = 'Pubmed XML' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Pubmed XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Pubmed XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A070' WHERE format_name = 'RefWorks' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'RefWorks' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'RefWorks' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_spec = 'import_ris2refbase.php', order_by = 'A080', depends_id = 1 WHERE format_name = 'RIS' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'RIS' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'RIS' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A090' WHERE format_name = 'SciFinder' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'SciFinder' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'SciFinder' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A100' WHERE format_name = 'Text (Tab-Delimited)' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Text (Tab-Delimited)' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Text (Tab-Delimited)' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A150' WHERE format_name = 'CrossRef XML' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'CrossRef XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'CrossRef XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_modsxml2refbase.php', order_by = 'A160', depends_id = 2 WHERE format_name = 'MODS XML' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'MODS XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'MODS XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'A170' WHERE format_name = 'OAI_DC XML' AND format_type = 'import'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'OAI_DC XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'OAI_DC XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Add new import formats in table 'formats' > $values = "(NULL, 'Copac', 'import', 'true', 'bibutils/import_copac2refbase.php', 'A020', 2)"; >@@ -650,47 +650,47 @@ > // Update existing export formats in table 'formats' > $query = "UPDATE " . $tableFormats . " SET order_by = 'B010' WHERE format_name = 'BibTeX' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'BibTeX' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'BibTeX' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B040' WHERE format_name = 'Endnote' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Endnote' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Endnote' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B050' WHERE format_name = 'ISI' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'ISI' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'ISI' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B080' WHERE format_name = 'RIS' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'RIS' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'RIS' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B105' WHERE format_name = 'Text (CSV)' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Text (CSV)' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Text (CSV)' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_name = 'Atom XML', format_enabled = 'true', format_spec ='export_atomxml.php', order_by = 'B140' WHERE format_name = 'OpenSearch RSS' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'OpenSearch RSS' export format, and renamed it to 'Atom XML'. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'OpenSearch RSS' export format, and renamed it to 'Atom XML'. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B160' WHERE format_name = 'MODS XML' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'MODS XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'MODS XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B170' WHERE format_name = 'OAI_DC XML' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'OAI_DC XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'OAI_DC XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B180' WHERE format_name = 'ODF XML' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'ODF XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'ODF XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET format_name = 'SRW_MODS XML', order_by = 'B195' WHERE format_name = 'SRW XML' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'SRW XML' export format, and renamed it to 'SRW_MODS XML'. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'SRW XML' export format, and renamed it to 'SRW_MODS XML'. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'B200' WHERE format_name = 'Word XML' AND format_type = 'export'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Word XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Word XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Add new export formats in table 'formats' > $values = "(NULL, 'ADS', 'export', 'true', 'bibutils/export_xml2ads.php', 'B005', 2)"; >@@ -720,31 +720,31 @@ > // Update existing citation formats in table 'formats' > $query = "UPDATE " . $tableFormats . " SET order_by = 'C010' WHERE format_name = 'html' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'html' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'html' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'C020' WHERE format_name = 'RTF' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'RTF' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'RTF' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'C030' WHERE format_name = 'PDF' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'PDF' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'PDF' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'C040' WHERE format_name = 'LaTeX' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'LaTeX' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'LaTeX' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'C045' WHERE format_name = 'LaTeX .bbl' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'LaTeX .bbl' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'LaTeX .bbl' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'C050' WHERE format_name = 'Markdown' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'Markdown' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'Markdown' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > $query = "UPDATE " . $tableFormats . " SET order_by = 'C060' WHERE format_name = 'ASCII' AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); >- $resultArray["Table 'formats': updated 'ASCII' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); >+ $resultArray["Table 'formats': updated 'ASCII' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); > > // Add new citation formats in table 'formats' > $values = "(NULL, 'html', 'cite', 'true', 'formats/cite_html.php', 'C010', 1)"; >@@ -773,10 +773,10 @@ > $formatIDArray = array(); > $query = "SELECT format_id, format_name FROM " . $tableFormats . " WHERE (format_name RLIKE '^(BibTeX|Endnote|RIS)$' AND format_type = 'export')"; > $result = queryMySQLDatabase($query); >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) > { >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > $formatIDArray[$row['format_id']] = $row['format_name']; > } > >@@ -791,10 +791,10 @@ > $formatIDArray = array(); > $query = "SELECT format_id, format_name FROM " . $tableFormats . " WHERE (format_name RLIKE '^(ISI|ODF XML|Word XML)$' AND format_type = 'export') OR (format_name RLIKE '^(html|RTF|PDF|LaTeX)$' AND format_type = 'cite')"; > $result = queryMySQLDatabase($query); >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) > { >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > $formatIDArray[$row['format_id']] = $row['format_name']; > } > >@@ -802,10 +802,10 @@ > $styleIDArray = array(); > $query = "SELECT style_id, style_name FROM " . $tableStyles . " WHERE style_name RLIKE '^(AMA|APA|Chicago|Harvard( [0-9]+)?|J Glaciol|MLA|Vancouver)$'"; > $result = queryMySQLDatabase($query); >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) > { >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > $styleIDArray[$row['style_id']] = $row['style_name']; > } > >@@ -813,10 +813,10 @@ > $typeIDArray = array(); > $query = "SELECT type_id, type_name FROM " . $tableTypes . " WHERE type_name RLIKE '^(Abstract|Conference Article|Conference Volume|Magazine Article|Manual|Miscellaneous|Newspaper Article|Patent|Report|Software)$'"; > $result = queryMySQLDatabase($query); >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) > { >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > $typeIDArray[$row['type_id']] = $row['type_name']; > } > >@@ -843,10 +843,10 @@ > // First, check how many users are contained in table 'users': > $query = "SELECT user_id, first_name, last_name FROM " . $tableUsers; > $result = queryMySQLDatabase($query); >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows (= user IDs) found ... > { >- while ($row = @ mysql_fetch_array($result)) >+ while ($row = @ $result->fetch_array()) > { > foreach ($formatIDArray as $formatID => $formatName) > { >diff -aurwN a/user_details.php b/user_details.php >--- a/user_details.php 2012-02-28 19:55:06.000000000 -0500 >+++ b/user_details.php 2016-12-26 21:13:25.275546992 -0500 >@@ -170,7 +170,7 @@ > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > > // (3b) EXTRACT results: >- $row = mysql_fetch_array($result); //fetch the current row into the array $row >+ $row = $result->fetch_array(); //fetch the current row into the array $row > > // If the admin is logged in AND the displayed user data are NOT his own, we overwrite the default header message: > // (Since the admin is allowed to view and edit account data from other users, we have to provide a dynamic header message in that case) >diff -aurwN a/user_login.php b/user_login.php >--- a/user_login.php 2013-09-20 13:36:17.000000000 -0400 >+++ b/user_login.php 2016-12-26 21:13:25.276546980 -0500 >@@ -121,10 +121,10 @@ > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > > // (4) EXTRACT results: >- if (mysql_num_rows($result) == 1) // Interpret query result: Do we have exactly one row? >+ if ($result->num_rows == 1) // Interpret query result: Do we have exactly one row? > { > $foundUser = true; // then we have found the user >- $row = mysql_fetch_array($result); // fetch the one row into the array '$row' >+ $row = $result->fetch_array(); // fetch the one row into the array '$row' > } > else > $foundUser = false; >@@ -146,7 +146,7 @@ > // Now we need to get the user's first name and last name (e.g., in order to display them within the login welcome message) > $query = "SELECT user_id, first_name, last_name, abbrev_institution, language, last_login FROM $tableUsers WHERE user_id = " . quote_smart($userID); // CONSTRUCT SQL QUERY > $result = queryMySQLDatabase($query); // RUN the query on the database through the connection (function 'queryMySQLDatabase()' is defined in 'include.inc.php') >- $row2 = mysql_fetch_array($result); // EXTRACT results: fetch the one row into the array '$row2' >+ $row2 = $result->fetch_array(); // EXTRACT results: fetch the one row into the array '$row2' > > // Save the fetched user details to the session file: > >diff -aurwN a/user_options.php b/user_options.php >--- a/user_options.php 2013-04-16 06:37:01.000000000 -0400 >+++ b/user_options.php 2016-12-26 21:13:25.278546955 -0500 >@@ -170,7 +170,7 @@ > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > > // (3b) EXTRACT results: >- $row = mysql_fetch_array($result); // fetch the current row into the array $row >+ $row = $result->fetch_array(); // fetch the current row into the array $row > > // If the admin is logged in AND the displayed user data are NOT his own, we overwrite the default header message: > // (Since the admin is allowed to view and edit account data from other users, we have to provide a dynamic header message in that case) >diff -aurwN a/user_options_modify.php b/user_options_modify.php >--- a/user_options_modify.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/user_options_modify.php 2016-12-26 21:13:25.279546943 -0500 >@@ -405,7 +405,7 @@ > // RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- if (mysql_num_rows($result) == 1) // if there's already an existing user_data entry, we perform an UPDATE action: >+ if ($result->num_rows == 1) // if there's already an existing user_data entry, we perform an UPDATE action: > $queryArray[] = "UPDATE $tableUserOptions SET " > . "export_cite_keys = " . quote_smart($formVars["export_cite_keys"]) > . ", autogenerate_cite_keys = " . quote_smart($formVars["autogenerate_cite_keys"]) >diff -aurwN a/user_receipt.php b/user_receipt.php >--- a/user_receipt.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/user_receipt.php 2016-12-26 21:13:25.280546930 -0500 >@@ -238,7 +238,7 @@ > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > > // (4) EXTRACT results (since 'user_id' is the unique primary key for the 'users' table, there will be only one matching row) >- $row = @ mysql_fetch_array($result); >+ $row = @ $result->fetch_array(); > > // Build the correct header message: > if (!isset($_SESSION['HeaderString'])) // if there's no saved message >@@ -294,7 +294,7 @@ > > echo "\n\t\t<tr>\n\t\t\t<td align=\"left\"><b>Account Details:</b></td>"; > >- if (mysql_num_rows($result) == 1) // If there's a user associated with this user ID >+ if ($result->num_rows == 1) // If there's a user associated with this user ID > { > // Add edit/delete button: > echo "\n\t\t\t<td align=\"left\">"; >@@ -404,7 +404,7 @@ > echo "\n\t\t<tr>\n\t\t\t<td align=\"left\"><b>Display Options:</b></td>" > . "\n\t\t\t<td align=\"right\">"; > >- if ((mysql_num_rows($result) == 1) OR ($userID == 0)) // If there's a user associated with this user ID (or if we're supposed to display options/permissions for anyone who isn't logged in) >+ if (($result->num_rows == 1) OR ($userID == 0)) // If there's a user associated with this user ID (or if we're supposed to display options/permissions for anyone who isn't logged in) > echo "<a href=\"user_options.php?userID=" . $userID . "\"><img src=\"img/options.gif\" alt=\"" . $loc["options"] . "\" title=\"" . $loc["LinkTitle_EditOptions"] . "\" width=\"11\" height=\"17\" hspace=\"0\" border=\"0\"></a>"; > > echo "</td>\n\t\t</tr>"; >@@ -413,7 +413,7 @@ > echo "\n\t\t<tr valign=\"top\">" > . "\n\t\t\t<td>Use language:</td>"; > >- if (mysql_num_rows($result) == 1) // If there's a user associated with this user ID >+ if ($result->num_rows == 1) // If there's a user associated with this user ID > echo "\n\t\t\t<td>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>" . $row["language"] . "</li>\n\t\t\t\t</ul>\n\t\t\t</td>"; > else // no user exists with this user ID > echo "\n\t\t\t<td>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>" . $defaultLanguage . "</li>\n\t\t\t\t</ul>\n\t\t\t</td>"; >@@ -596,7 +596,7 @@ > echo "\n\t\t<tr>\n\t\t\t<td align=\"left\"><b>User Permissions:</b></td>" > . "\n\t\t\t<td align=\"right\">"; > >- if ((mysql_num_rows($result) == 1) OR ($userID == 0)) // If there's a user associated with this user ID (or if we're supposed to display options/permissions for anyone who isn't logged in) >+ if (($result->num_rows == 1) OR ($userID == 0)) // If there's a user associated with this user ID (or if we're supposed to display options/permissions for anyone who isn't logged in) > echo "<a href=\"user_options.php?userID=" . $userID . "#permissions\"><img src=\"img/options.gif\" alt=\"" . $loc["permissions"] . "\" title=\"" . $loc["LinkTitle_EditPermissions"] . "\" width=\"11\" height=\"17\" hspace=\"0\" border=\"0\"></a>"; > > echo "</td>\n\t\t</tr>"; >diff -aurwN a/user_validation.php b/user_validation.php >--- a/user_validation.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/user_validation.php 2016-12-26 21:13:25.282546905 -0500 >@@ -203,7 +203,7 @@ > // (3) RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- if (mysql_num_rows($result) == 1) // (4) Interpret query result: Is it taken? >+ if ($result->num_rows == 1) // (4) Interpret query result: Is it taken? > $errors["email"] = "A user already exists with this email address as login name.\n\t\t<br>\n\t\tPlease enter a different one:"; > } > } >@@ -353,7 +353,7 @@ > // (3a) RUN the query on the database through the connection: > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' > >- $row = mysql_fetch_array($result); // (3b) EXTRACT results: fetch the current row into the array $row >+ $row = $result->fetch_array(); // (3b) EXTRACT results: fetch the current row into the array $row > > // 1) Mail feedback to user, i.e., send the person who wants to be added as new user a notification email: > $emailRecipient = $formVars["firstName"] . " " . $formVars["lastName"] . " <" . $formVars["email"] . ">"; >@@ -448,7 +448,7 @@ > elseif ((!isset($_SESSION['loginEmail']) && ($addNewUsers == "everyone") && ($_REQUEST['userID'] == "")) | (isset($_SESSION['loginEmail']) && ($loginEmail == $adminLoginEmail) && ($_REQUEST['userID'] == ""))) // -> perform an insert: > { > // Get the user id that was created >- $userID = @ mysql_insert_id($connection); >+ $userID = @ $connection->insert_id; > > // Use the first two characters of the email as a salt for the password > $salt = substr($formVars["email"], 0, 2); >@@ -477,7 +477,7 @@ > // get the 'format_id' for the record entry in table 'formats' whose 'format_name' matches that in '$defaultUserExportFormats' (defined in 'ini.inc.php'): > $query = "SELECT format_id FROM $tableFormats WHERE format_name = " . quote_smart($defaultUserExportFormat) . " AND format_type = 'export'"; > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > // Insert a row with the found format ID for this new user into the 'user_formats' table: > $queryArray[] = "INSERT INTO $tableUserFormats VALUES (NULL, " . quote_smart($row["format_id"]) . ", " . quote_smart($userID) . ", \"true\")"; >@@ -488,7 +488,7 @@ > // get the 'format_id' for the record entry in table 'formats' whose 'format_name' matches that in '$defaultUserCiteFormats' (defined in 'ini.inc.php'): > $query = "SELECT format_id FROM $tableFormats WHERE format_name = " . quote_smart($defaultUserCiteFormat) . " AND format_type = 'cite'"; > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > // Insert a row with the found format ID for this new user into the 'user_formats' table: > $queryArray[] = "INSERT INTO $tableUserFormats VALUES (NULL, " . quote_smart($row["format_id"]) . ", " . quote_smart($userID) . ", \"true\")"; >@@ -499,7 +499,7 @@ > // get the 'style_id' for the record entry in table 'styles' whose 'style_name' matches that in '$defaultUserStyles' (defined in 'ini.inc.php'): > $query = "SELECT style_id FROM $tableStyles WHERE style_name = " . quote_smart($defaultUserStyle); > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > // Insert a row with the found style ID for this new user into the 'user_styles' table: > $queryArray[] = "INSERT INTO $tableUserStyles VALUES (NULL, " . quote_smart($row["style_id"]) . ", " . quote_smart($userID) . ", \"true\")"; >@@ -510,7 +510,7 @@ > // get the 'type_id' for the record entry in table 'types' whose 'type_name' matches that in '$defaultUserTypes' (defined in 'ini.inc.php'): > $query = "SELECT type_id FROM $tableTypes WHERE type_name = " . quote_smart($defaultUserType); > $result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' >- $row = mysql_fetch_array($result); >+ $row = $result->fetch_array(); > > // Insert a row with the found type ID for this new user into the 'user_types' table: > $queryArray[] = "INSERT INTO $tableUserTypes VALUES (NULL, " . quote_smart($row["type_id"]) . ", " . quote_smart($userID) . ", \"true\")"; >diff -aurwN a/users.php b/users.php >--- a/users.php 2012-02-27 15:25:30.000000000 -0500 >+++ b/users.php 2016-12-26 21:15:23.769081822 -0500 >@@ -186,7 +186,7 @@ > $queryURL = rawurlencode($query); // URL encode SQL query > > // First, find out how many rows are available: >- $rowsFound = @ mysql_num_rows($result); >+ $rowsFound = @ $result->num_rows; > if ($rowsFound > 0) // If there were rows found ... > { > // ... setup variables in order to facilitate "previous" & "next" browsing: >@@ -218,7 +218,7 @@ > $nextOffset = $rowOffset + $showRows; > > // d) Seek to the current offset >- mysql_data_seek($result, $rowOffset); >+ $result->data_seek($rowOffset); > } > else // set variables to zero in order to prevent 'Undefined variable...' messages when nothing was found ('$rowsFound = 0'): > { >@@ -296,7 +296,7 @@ > $CounterMax = "0"; > > // count the number of fields >- $fieldsFound = mysql_num_fields($result); >+ $fieldsFound = $result->field_count; > // hide those last columns that were added by the script and not by the user > $fieldsToDisplay = $fieldsFound-(1+$CounterMax); // (1+$CounterMax) -> $CounterMax is increased by 1 in order to hide the user_id column (which was added to make the checkbox work) > >@@ -432,7 +432,7 @@ > echo "</tr>"; > > // BEGIN RESULTS DATA COLUMNS -------------- >- for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++) >+ for ($rowCounter=0; (($rowCounter < $showRows) && ($row = @ $result->fetch_array())); $rowCounter++) > { > if (is_integer($rowCounter / 2)) // if we currently are at an even number of rows > $rowClass = "even";
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 603988
: 457686