diff --git a/addcomment.php b/addcomment.php index 8c1272a..92bedaf 100644 --- a/addcomment.php +++ b/addcomment.php @@ -48,7 +48,7 @@ if(!empty($aClean['sBody'])) { $hResult = query_parameters("SELECT * FROM appComments WHERE commentId = '?'", $aClean['iThread']); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow) { $mesTitle = "Replying To ... $oRow->subject\n"; diff --git a/admin/addAppNote.php b/admin/addAppNote.php index 8d3cdc2..ae1f96c 100644 --- a/admin/addAppNote.php +++ b/admin/addAppNote.php @@ -10,7 +10,7 @@ require_once(BASE."include/note.php"); //FIXME: get rid of appId references everywhere, as version is enough. $sQuery = "SELECT appId FROM appVersion WHERE versionId = '?'"; $hResult = query_parameters($sQuery, $aClean['iVersionId']); -$oRow = mysql_fetch_object($hResult); +$oRow = query_fetch_object($hResult); $appId = $oRow->appId; //check for admin privs diff --git a/admin/addCategory.php b/admin/addCategory.php index fa6f16e..0159249 100644 --- a/admin/addCategory.php +++ b/admin/addCategory.php @@ -18,7 +18,7 @@ else apidb_header("Add Category"); $sQuery = "SELECT catId, catName FROM appCategory WHERE catId!='?'"; $hResult = query_parameters($sQuery, $aClean['iCatId']); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aCatsIds[]=$oRow->catId; $aCatsNames[]=$oRow->catName; diff --git a/admin/adminBugs.php b/admin/adminBugs.php index d0ce6ac..4a9cf28 100644 --- a/admin/adminBugs.php +++ b/admin/adminBugs.php @@ -111,13 +111,13 @@ if (isset($aClean['sSub'])) FROM appFamily, appVersion, buglinks, bugs.bugs ".$sWhere." ORDER BY buglinks.bug_id, appName, versionName - LIMIT ".mysql_real_escape_string($offset).", ".mysql_real_escape_string($ItemsPerPage).";"; + LIMIT ".query_escape_string($offset).", ".query_escape_string($ItemsPerPage).";"; $c = 0; if($hResult = query_parameters($sQuery)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oApp = new application($oRow->appId); $oVersion = new version($oRow->versionId); diff --git a/admin/adminCommentView.php b/admin/adminCommentView.php index a12aa62..eb947cf 100644 --- a/admin/adminCommentView.php +++ b/admin/adminCommentView.php @@ -52,14 +52,14 @@ echo ""; $offset = (($currentPage-1) * $ItemsPerPage); $commentIds = query_parameters("SELECT commentId from appComments ORDER BY ". "appComments.time ASC LIMIT ?, ?", $offset, $ItemsPerPage); -while ($oRow = mysql_fetch_object($commentIds)) +while ($oRow = query_fetch_object($commentIds)) { $sQuery = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ". "commentId, parentId, versionId, userid, subject, body ". "FROM appComments WHERE commentId = '?'"; $hResult = query_parameters($sQuery, $oRow->commentId); /* call view_app_comment to display the comment */ - $oComment_row = mysql_fetch_object($hResult); + $oComment_row = query_fetch_object($hResult); Comment::view_app_comment($oComment_row); } diff --git a/admin/adminMaintainers.php b/admin/adminMaintainers.php index a6ee83f..041a888 100644 --- a/admin/adminMaintainers.php +++ b/admin/adminMaintainers.php @@ -38,7 +38,7 @@ if (isset($aClean['sSub'])) $sQuery.= " AND queued='false' ORDER BY realname;"; $hResult = query_parameters($sQuery); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) { // no apps echo html_frame_start("","90%"); @@ -61,7 +61,7 @@ if (isset($aClean['sSub'])) $c = 1; $oldUserId = 0; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oUser = new User($oRow->userId); $oApp = new application($oRow->appId); diff --git a/admin/adminScreenshots.php b/admin/adminScreenshots.php index 0d433bd..4cca6f5 100644 --- a/admin/adminScreenshots.php +++ b/admin/adminScreenshots.php @@ -37,7 +37,7 @@ if(isset($aClean['sRegenerate'])) { $sQuery = "SELECT id FROM appData WHERE type = 'screenshot'"; $hResult = query_parameters($sQuery); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { echo "REGENERATING IMAGE ".$oRow->id."
"; $screenshot = new Screenshot($oRow->id); @@ -100,7 +100,7 @@ $Ids = query_parameters("SELECT * from appData ORDER BY id ASC LIMIT ?, ?", $offset, $ItemsPerPage); $c = 1; echo "
\n"; -while ($oRow = mysql_fetch_object($Ids)) +while ($oRow = query_fetch_object($Ids)) { // display thumbnail $oVersion = new Version($oRow->versionId); diff --git a/admin/adminUsers.php b/admin/adminUsers.php index 81c04d6..20d4957 100644 --- a/admin/adminUsers.php +++ b/admin/adminUsers.php @@ -121,7 +121,7 @@ if(isset($aClean['sSubmit'])) $hResult = query_parameters($sQuery, $sSearch, $sSearch, $aClean['sOrderBy'], $aClean['iLimit']); $i=0; - while($hResult && $oRow = mysql_fetch_object($hResult)) + while($hResult && $oRow = query_fetch_object($hResult)) { $oUser = new User($oRow->userid); $sAreYouSure = "Are you sure that you want to delete user ".addslashes($oUser->sRealname)." ?"; diff --git a/admin/editBundle.php b/admin/editBundle.php index c7e289a..cb45429 100644 --- a/admin/editBundle.php +++ b/admin/editBundle.php @@ -11,7 +11,7 @@ function build_app_list() $hResult = query_parameters("SELECT appId, appName FROM appFamily ORDER BY appName"); echo "\n"; echo " \n"; echo "\n\n"; -if($hResult && mysql_num_rows($hResult)) +if($hResult && query_num_rows($hResult)) { $c = 1; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { //set row color if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } @@ -72,7 +72,7 @@ if($hResult && mysql_num_rows($hResult)) $c++; } -} else if($hResult && !mysql_num_rows($hResult)) +} else if($hResult && !query_num_rows($hResult)) { /* indicate to the user that there are no apps in this bundle at the moment */ echo "\n"; diff --git a/admin/maintainerNotification.php b/admin/maintainerNotification.php index e078ca4..423b306 100644 --- a/admin/maintainerNotification.php +++ b/admin/maintainerNotification.php @@ -15,7 +15,7 @@ $hResult = maintainer::objectGetEntries(false, false); echo "Maintainers with a non-zero notification level
\n"; $bFoundNonZero = false; -while($oRow = mysql_fetch_object($hResult)) +while($oRow = query_fetch_object($hResult)) { $oMaintainer = new maintainer(null, $oRow); @@ -41,7 +41,7 @@ echo "
\n"; // retrieve all of the maintainers echo "Maintainers with notification iTargetLevel != 0
\n"; $hResult = maintainer::objectGetEntries(false, false); -while($oRow = mysql_fetch_object($hResult)) +while($oRow = query_fetch_object($hResult)) { $oMaintainer = new maintainer(null, $oRow); diff --git a/admin/moveAppVersion.php b/admin/moveAppVersion.php index daa69c6..e99478d 100644 --- a/admin/moveAppVersion.php +++ b/admin/moveAppVersion.php @@ -47,7 +47,7 @@ if(!empty($aClean['sAction'])) $sQuery.= "on appVersion.appId = appFamily.appId ORDER BY appFamily.appName, appFamily.appId, appVersion.versionName;"; $hResult = query_parameters($sQuery); $currentAppId = 0; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { /* if the version ids differ then we should start a row with a new application */ /* and the version that matches with it */ diff --git a/appview.php b/appview.php index 272f4ca..b5e20f3 100644 --- a/appview.php +++ b/appview.php @@ -37,7 +37,7 @@ function display_bundle($iAppId) $hResult = query_parameters("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ". "WHERE appFamily.queued='false' AND bundleId = '?' AND appBundle.appId = appFamily.appId", $iAppId); - if(!$hResult || mysql_num_rows($hResult) == 0) + if(!$hResult || query_num_rows($hResult) == 0) { return; // do nothing } @@ -51,7 +51,7 @@ function display_bundle($iAppId) echo "\n\n"; $c = 0; - while($ob = mysql_fetch_object($hResult)) + while($ob = query_fetch_object($hResult)) { $oApp = new application($ob->appId); //set row color diff --git a/browse_downloadable.php b/browse_downloadable.php index d80a9bc..0125f84 100644 --- a/browse_downloadable.php +++ b/browse_downloadable.php @@ -37,8 +37,8 @@ else $hResult = query_parameters($sQuery, "downloadurl", $sLicense); } -if($hResult && mysql_num_rows($hResult)) - $num = mysql_num_rows($hResult); +if($hResult && query_num_rows($hResult)) + $num = query_num_rows($hResult); $iNumPages = isset($num) ? ceil($num/$aClean['iNumVersions']) : 0; @@ -108,7 +108,7 @@ if(!$sLicense) $aClean['iNumVersions']); } -if($hResult && mysql_num_rows($hResult)) +if($hResult && query_num_rows($hResult)) { echo html_frame_start("", "90%"); @@ -127,7 +127,7 @@ if($hResult && mysql_num_rows($hResult)) $oTableRow->SetClass("color4"); $oTable->AddRow($oTableRow); - for($iIndex = 1; $oRow = mysql_fetch_object($hResult); $iIndex++) + for($iIndex = 1; $oRow = query_fetch_object($hResult); $iIndex++) { $oVersion = new version($oRow->versionId); diff --git a/cron/cleanup.php b/cron/cleanup.php index 69a9a5c..b16a1cc 100644 --- a/cron/cleanup.php +++ b/cron/cleanup.php @@ -52,7 +52,7 @@ function inactiveUserCheck() $hUsersToWarn = unwarnedAndInactiveSince(6); if($hUsersToWarn) { - while($oRow = mysql_fetch_object($hUsersToWarn)) + while($oRow = query_fetch_object($hUsersToWarn)) { $oUser = new User($oRow->userid); @@ -73,7 +73,7 @@ function inactiveUserCheck() $hUsersToDelete = warnedSince(1); if($hUsersToDelete) { - while($oRow = mysql_fetch_object($hUsersToDelete)) + while($oRow = query_fetch_object($hUsersToDelete)) { $oUser = new User($oRow->userid); if(!$oUser->hasDataAssociated()) @@ -179,11 +179,11 @@ function orphanVersionCheck() $sMsg.= "this sql command '".$sQuery."'\r\n"; /* don't report anything if no orphans are found */ - if(mysql_num_rows($hResult) == 0) + if(query_num_rows($hResult) == 0) return; $sMsg .= "versionId/name\r\n"; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $sMsg .= $oRow->versionId."/".$oRow->versionName."\r\n"; } @@ -209,7 +209,7 @@ function orphanSessionMessagesCheck() $sQuery = "SELECT count(*) as cnt from sessionMessages where TO_DAYS(NOW()) - TO_DAYS(time) > ?"; $hResult = query_parameters($sQuery, $iSessionMessageDayLimit); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $iMessages = $oRow->cnt; $sMsg = "Found ".$iMessages." that have been orphaned in the sessionMessages table for longer than ".$iSessionMessageDayLimit." days\r\n"; @@ -237,7 +237,7 @@ function orphanSessionListCheck() $sQuery = "SELECT count(*) as cnt from session_list where TO_DAYS(NOW()) - TO_DAYS(stamp) > ?"; $hResult = query_parameters($sQuery, SESSION_DAYS_TO_EXPIRE + 2); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $iMessages = $oRow->cnt; $sMsg = "Found ".$iMessages." sessions that have expired after ".(SESSION_DAYS_TO_EXPIRE + 2)." days\r\n"; @@ -272,7 +272,7 @@ function getMissingScreenshotArray() $hResult = Screenshot::objectGetEntries(false, false); // go through each screenshot - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $iScreenshotId = $oRow->id; $oScreenshot = new Screenshot($iScreenshotId); diff --git a/include/appData.php b/include/appData.php index 58bd46f..4737ffc 100644 --- a/include/appData.php +++ b/include/appData.php @@ -37,7 +37,7 @@ class appData if(!$oRow) { $hResult = query_parameters("SELECT * FROM appData WHERE id = '?'", $iId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); } if($oRow) @@ -126,7 +126,7 @@ class appData ORDER BY appData.id", $iUserId, $bQueued ? "true" : "false"); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) return false; $sReturn = html_table_begin("width=\"100%\" align=\"center\""); @@ -137,7 +137,7 @@ class appData "Submission Date"), "color4"); - for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + for($i = 1; $oRow = query_fetch_object($hResult); $i++) { if($oRow->versionId) { @@ -180,7 +180,7 @@ class appData versionId = '?' AND TYPE = '?' AND queued = '?'", $iAppId, $iVersionId, $sType, $sQueued); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) return FALSE; return $hResult; @@ -297,7 +297,7 @@ class appData if(!$hResult) return FALSE; - for($iCount = 0; $oRow = mysql_fetch_object($hResult);) + for($iCount = 0; $oRow = query_fetch_object($hResult);) $iCount += $oRow->count; return $iCount; diff --git a/include/appdb.php b/include/appdb.php index 532cb8c..51bd8e8 100644 --- a/include/appdb.php +++ b/include/appdb.php @@ -6,9 +6,9 @@ function log_category_visit($catId) $result = query_parameters("SELECT * FROM catHitStats WHERE ip = '?' AND catId = '?'", $REMOTE_ADDR, $catId); - if($result && mysql_num_rows($result) == 1) + if($result && query_num_rows($result) == 1) { - $oStatsRow = mysql_fetch_object($result); + $oStatsRow = query_fetch_object($result); query_parameters("UPDATE catHitStats SET count = count + 1 WHERE catHitId = '?'", $oStatsRow->catHitId); } else @@ -25,9 +25,9 @@ function log_application_visit($appId) $result = query_parameters("SELECT * FROM appHitStats WHERE ip = '?' AND appId = '?'", $REMOTE_ADDR, $appId); - if($result && mysql_num_rows($result) == 1) + if($result && query_num_rows($result) == 1) { - $stats = mysql_fetch_object($result); + $stats = query_fetch_object($result); query_parameters("UPDATE appHitStats SET count = count + 1 WHERE appHitId = '?'", $stats->appHitId); } else diff --git a/include/application.php b/include/application.php index 04c7d6e..d5f26d3 100644 --- a/include/application.php +++ b/include/application.php @@ -56,7 +56,7 @@ class Application { FROM appFamily WHERE appId = '?'"; if($hResult = query_parameters($sQuery, $iAppId)) - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); } if($oRow) @@ -89,7 +89,7 @@ class Application { } if($hResult) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $this->aVersionsIds[] = $oRow->versionId; } @@ -132,7 +132,7 @@ class Application { $this->mustBeQueued() ? "true" : "false"); if($hResult) { - $this->iAppId = mysql_insert_id(); + $this->iAppId = query_appdb_insert_id(); $this->application($this->iAppId); $this->SendNotificationMail(); // Only administrators will be mailed as no supermaintainers exist for this app. @@ -246,7 +246,7 @@ class Application { //FIXME: how to deal with concurrency issues such as // if a new version was added during this deletion? $hResult = $this->_internal_retrieve_all_versions(); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $iVersionId = $oRow->versionId; $oVersion = new Version($iVersionId); @@ -263,7 +263,7 @@ class Application { if($hResult = query_parameters($sQuery, $this->iAppId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aUrlsIds[] = $oRow->id; } @@ -315,9 +315,9 @@ class Application { /* Unqueue matching super maintainer request */ $hResultMaint = query_parameters("SELECT maintainerId FROM appMaintainers WHERE userId = '?' AND appId = '?'", $this->iSubmitterId, $this->iAppId); - if($hResultMaint && mysql_num_rows($hResultMaint)) + if($hResultMaint && query_num_rows($hResultMaint)) { - $oMaintainerRow = mysql_fetch_object($hResultMaint); + $oMaintainerRow = query_fetch_object($hResultMaint); $oMaintainer = new Maintainer($oMaintainerRow->maintainerId); $oMaintainer->unQueue("OK"); } @@ -420,7 +420,7 @@ class Application { if($hResult = query_parameters($sQuery, $sRating)) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); } return $oRow->total; } @@ -436,7 +436,7 @@ class Application { if($hResult = query_parameters($sQuery, $sRating, $iOffset, $iItemsPerPage)) { - while($aRow = mysql_fetch_row($hResult)) + while($aRow = query_fetch_row($hResult)) { array_push($aApps, $aRow[0]); } @@ -764,9 +764,9 @@ class Application { if(!$appId) return null; $result = query_parameters("SELECT appName FROM appFamily WHERE appId = '?'", $appId); - if(!$result || mysql_num_rows($result) != 1) + if(!$result || query_num_rows($result) != 1) return null; - $ob = mysql_fetch_object($result); + $ob = query_fetch_object($result); return $ob->appName; } @@ -781,7 +781,7 @@ class Application { queued = '?' ORDER BY appId", $iUserId, $bQueued ? "true" : "false"); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) return false; $oTable = new Table(); @@ -796,7 +796,7 @@ class Application { $oTableRow->SetClass("color4"); $oTable->SetHeader($oTableRow); - for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + for($i = 1; $oRow = query_fetch_object($hResult); $i++) { $oVendor = new vendor($oRow->vendorId); @@ -1013,7 +1013,7 @@ class Application { if(!$hResult) return FALSE; - if(!$oRow = mysql_fetch_object($hResult)) + if(!$oRow = query_fetch_object($hResult)) return FALSE; return $oRow->count; diff --git a/include/application_queue.php b/include/application_queue.php index 5a503c2..b99dbd2 100644 --- a/include/application_queue.php +++ b/include/application_queue.php @@ -30,7 +30,7 @@ class application_queue $hResult = query_parameters($sQuery, $this->oApp->iAppId); if($hResult) { - if($oRow = mysql_fetch_object($hResult)) + if($oRow = query_fetch_object($hResult)) $iVersionId = $oRow->versionId; } } @@ -230,7 +230,7 @@ class application_queue return FALSE; /* There's no point in displaying an empty table */ - if($hResult === null ||mysql_num_rows($hResult) == 0) + if($hResult === null || (query_num_rows($hResult) == 0)) { echo "No matches.
\n"; return; @@ -256,7 +256,7 @@ class application_queue echo "
Application Name Delete
"; echo html_tr($aHeader, "color4"); - for($i = 0; $oRow = mysql_fetch_object($hResult); $i++) + for($i = 0; $oRow = query_fetch_object($hResult); $i++) { $oApp = new application($oRow->appId); $aCells = array( diff --git a/include/bugs.php b/include/bugs.php index ce26712..eea8a78 100644 --- a/include/bugs.php +++ b/include/bugs.php @@ -39,7 +39,7 @@ class Bug { AND linkid = '?'"; if($hResult = query_parameters($sQuery, $iLinkId)) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $this->iLinkId = $iLinkId; $this->iAppId = $oRow->appId; $this->iBug_id = $oRow->bug_id; @@ -55,7 +55,7 @@ class Bug { WHERE bug_id = ".$this->iBug_id; if($hResult = query_bugzilladb($sQuery)) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $this->sShort_desc = $oRow->short_desc; $this->sBug_status = $oRow->bug_status; $this->sResolution = $oRow->resolution; @@ -95,7 +95,7 @@ class Bug { $sQuery = "SELECT * FROM bugs WHERE bug_id = ".$this->iBug_id; - if(mysql_num_rows(query_bugzilladb($sQuery, "checking bugzilla")) == 0) + if(query_num_rows(query_bugzilladb($sQuery, "checking bugzilla")) == 0) { addmsg("There is no bug in Bugzilla with that bug number.", "red"); return false; @@ -108,7 +108,7 @@ class Bug { WHERE versionId = '?'"; if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { if($oRow->bug_id == $this->iBug_id) { @@ -129,7 +129,7 @@ class Bug { $this->bQueued ? "true":"false"); if($hResult) { - $this->iLinkId = mysql_insert_id(); + $this->iLinkId = query_bugzilla_insert_id(); $this->SendNotificationMail(); @@ -259,7 +259,7 @@ class Bug { { $hResult = query_parameters("SELECT appFamily.appName, buglinks.versionId, appVersion.versionName, buglinks.submitTime, buglinks.bug_id FROM buglinks, appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.queued = '?' AND buglinks.submitterId = '?' ORDER BY buglinks.versionId", $bQueued ? "true" : "false", $iUserId); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) return FALSE; $sReturn = html_table_begin("width=\"100%\" align=\"center\""); @@ -272,7 +272,7 @@ class Bug { "Submit time"), "color4"); - for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + for($i = 1; $oRow = query_fetch_object($hResult); $i++) { $oBug = new Bug($oRow->bug_id); $sReturn .= html_tr(array( diff --git a/include/category.php b/include/category.php index c6d7d9d..c91dd0e 100644 --- a/include/category.php +++ b/include/category.php @@ -31,7 +31,7 @@ class Category { WHERE catId = '?' ORDER BY catName;"; if($hResult = query_parameters($sQuery, $iCatId)) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow) { $this->iCatId = $iCatId; @@ -50,7 +50,7 @@ class Category { AND queued = 'false' ORDER BY appName"; if($hResult = query_parameters($sQuery, $iCatId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $this->aApplicationsIds[] = $oRow->appId; } @@ -64,7 +64,7 @@ class Category { WHERE catParent = '?' ORDER BY catName;"; if($hResult = query_parameters($sQuery, $iCatId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $this->aSubcatsIds[] = $oRow->catId; } @@ -83,7 +83,7 @@ class Category { $sName, $sDescription, $iParentId); if($hResult) { - $this->iCatId = mysql_insert_id(); + $this->iCatId = query_appdb_insert_id(); $this->category($this->iCatId); return true; } @@ -171,9 +171,9 @@ class Category { { $hResult = query_parameters("SELECT catName, catId, catParent FROM appCategory WHERE catId = '?'", $iCatId); - if(!$hResult || mysql_num_rows($hResult) != 1) + if(!$hResult || query_num_rows($hResult) != 1) break; - $oCatRow = mysql_fetch_object($hResult); + $oCatRow = query_fetch_object($hResult); $aPath[] = array($oCatRow->catId, $oCatRow->catName); $iCatId = $oCatRow->catParent; } diff --git a/include/comment.php b/include/comment.php index 1144b5d..4e9ffe5 100644 --- a/include/comment.php +++ b/include/comment.php @@ -36,7 +36,7 @@ class Comment { WHERE appComments.versionId = appVersion.versionId AND commentId = '?'"; $hResult = query_parameters($sQuery, $iCommentId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $this->iCommentId = $oRow->commentId; $this->iParentId = $oRow->parentId; $this->iAppId = $oRow->appId; @@ -68,7 +68,7 @@ class Comment { if($hResult) { - $this->comment(mysql_insert_id()); + $this->comment(query_appdb_insert_id()); $sEmail = User::get_notify_email_address_list($this->iAppId, $this->iVersionId); $sEmail .= $this->oOwner->sEmail." "; @@ -203,7 +203,7 @@ class Comment { $hResult = query_parameters($sQuery, $iVersionId); if(!$hResult) return 0; - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->cnt; } @@ -275,8 +275,8 @@ class Comment { } /* escape input so we can use query_appdb() without concern */ - $iVersionId = mysql_real_escape_string($iVersionId); - $iParentId = mysql_real_escape_string($iParentId); + $iVersionId = query_escape_string($iVersionId); + $iParentId = query_escape_string($iParentId); $sExtra = ""; @@ -300,11 +300,11 @@ class Comment { */ function do_display_comments_nested($hResult) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { Comment::view_app_comment($oRow); $hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId); - if($hResult && mysql_num_rows($hResult2)) + if($hResult && query_num_rows($hResult2)) { echo "
\n"; Comment::do_display_comments_nested($hResult2); @@ -328,7 +328,7 @@ class Comment { if (!$is_main) echo "
\n"; @@ -151,8 +151,8 @@ class TableVE { for($i = 0; $i < $nfields; $i++) { global $testvar; - $field = mysql_fetch_field($hResult, $i); - $len = mysql_field_len($hResult, $i); + $field = query_fetch_field($hResult, $i); + $len = query_field_len($hResult, $i); if(ereg("^impl_(.+)$", $field->table, $arr)) { @@ -189,7 +189,7 @@ class TableVE { $sStr.= "id\" ". @@ -360,7 +360,7 @@ class Url { return FALSE; } - if(!($oRow = mysql_fetch_object($hResult))) + if(!($oRow = query_fetch_object($hResult))) return FALSE; $num = $oRow->num; @@ -378,7 +378,7 @@ class Url { return FALSE; } - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $url = new url($oRow->id); @@ -485,7 +485,7 @@ class Url { return FALSE; } - for($i = 0; $oRow = mysql_fetch_object($hResult); $i++) + for($i = 0; $oRow = query_fetch_object($hResult); $i++) { // create a url object $oUrl = new Url(null, $oRow); diff --git a/include/user.php b/include/user.php index 2532e20..b30dee3 100644 --- a/include/user.php +++ b/include/user.php @@ -40,7 +40,7 @@ class User { FROM user_list WHERE userId = '?'"; $hResult = query_parameters($sQuery, $iUserId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow) { $this->iUserId = $oRow->userid; @@ -81,7 +81,7 @@ class User { { $hResult = query_parameters($sQuery.$sMysqlSHAPasswordPart, $sEmail, $sPassword); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); } // if we aren't logged in yet @@ -90,7 +90,7 @@ class User { { $hResult = query_parameters($sQuery.$sMysqlPasswordPart, $sEmail, $sPassword); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow) $bUsedOldStylePassword = true; } @@ -107,7 +107,7 @@ class User { { $hResult = query_parameters($sQuery.$sMysql40xPasswordPart, $sEmail, $sPassword); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow) $bUsedOldStylePassword = true; } } @@ -265,9 +265,9 @@ class User { $hResult = query_parameters("SELECT * FROM user_prefs WHERE userid = '?' AND name = '?'", $this->iUserId, $sKey); - if(!$hResult || mysql_num_rows($hResult) == 0) + if(!$hResult || query_num_rows($hResult) == 0) return $sDef; - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->value; } @@ -300,7 +300,7 @@ class User { $this->iUserId, $sPriv); if(!$hResult) return false; - return mysql_num_rows($hResult); + return query_num_rows($hResult); } @@ -373,7 +373,7 @@ class User { WHERE submitterId = '?' AND appId = '?'", $this->iUserId, $iAppId); - if(mysql_num_rows($hResult)) + if(query_num_rows($hResult)) return true; else return false; @@ -386,7 +386,7 @@ class User { AND appVersion.submitterId = '?' AND appVersion.versionId = '?'", $this->iUserId, $iVersionId); - if(mysql_num_rows($hResult)) + if(query_num_rows($hResult)) return true; else return false; @@ -398,7 +398,7 @@ class User { { $hResult = query_parameters("SELECT count(userId) as c FROM appComments WHERE userId = '?'", $this->iUserId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow->c != 0) return true; if($this->isMaintainer() || $this->isSuperMaintainer()) @@ -406,7 +406,7 @@ class User { $hResult = query_parameters("SELECT count(userId) as c FROM appVotes WHERE userId = '?'", $this->iUserId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow->c != 0) return true; return false; @@ -468,12 +468,12 @@ class User { { $hResult = query_parameters("SELECT userid FROM user_list WHERE email = '?'", $sEmail); - if(!$hResult || mysql_num_rows($hResult) != 1) + if(!$hResult || query_num_rows($hResult) != 1) { return 0; } else { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->userid; } } @@ -485,7 +485,7 @@ class User { function objectGetEntriesCount($bQueued = null, $bRejected = null) { $hResult = query_parameters("SELECT count(*) as num_users FROM user_list;"); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->num_users; } @@ -496,7 +496,7 @@ class User { { $hResult = query_parameters("SELECT count(*) as num_users FROM user_list WHERE stamp >= DATE_SUB(CURDATE(), interval '?' day);", $days); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->num_users; } @@ -508,7 +508,7 @@ class User { { /* retrieve the number of users that have been warned and are pending deletion */ $hResult = query_parameters("select count(*) as count from user_list where inactivity_warned = 'true'"); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->count; } @@ -527,9 +527,9 @@ class User { if($hResult) { - if(mysql_num_rows($hResult) > 0) + if(query_num_rows($hResult) > 0) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) $aUserId[] = $oRow->userId; } } @@ -560,9 +560,9 @@ class User { } if($hResult) { - if(mysql_num_rows($hResult) > 0) + if(query_num_rows($hResult) > 0) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) $aUserId[] = $oRow->userId; } } @@ -571,9 +571,9 @@ class User { * Retrieve administrators. */ $hResult = query_parameters("SELECT * FROM user_privs WHERE priv = 'admin'"); - if(mysql_num_rows($hResult) > 0) + if(query_num_rows($hResult) > 0) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $i = array_search($oRow->userid, $aUserId); diff --git a/include/util.php b/include/util.php index aa2122b..59f348f 100644 --- a/include/util.php +++ b/include/util.php @@ -176,7 +176,7 @@ function make_bugzilla_version_list($sVarname, $sSelectedValue) // TODO: if we ever get a reasonable way to order the list replace this code // with that $aVersions = array(); - while(list($sValue) = mysql_fetch_row($hResult)) + while(list($sValue) = query_fetch_row($hResult)) { // exclude unspecified versions and the "CVS" version if(($sValue != "unspecified") && ($sValue != "CVS")) @@ -246,7 +246,7 @@ function make_maintainer_rating_list($varname, $cvalue) function getNumberOfComments() { $hResult = query_parameters("SELECT count(*) as num_comments FROM appComments;"); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->num_comments; } @@ -256,7 +256,7 @@ function getNumberOfQueuedBugLinks() $hResult = query_parameters("SELECT count(*) as num_buglinks FROM buglinks WHERE queued='true';"); if($hResult) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->num_buglinks; } return 0; @@ -268,7 +268,7 @@ function getNumberOfBugLinks() $hResult = query_parameters("SELECT count(*) as num_buglinks FROM buglinks;"); if($hResult) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return $oRow->num_buglinks; } return 0; @@ -316,8 +316,8 @@ function outputTopXRow($oRow) function outputTopXRowAppsFromRating($sRating, $iNumApps) { /* clean the input values so we can continue to use query_appdb() */ - $sRating = mysql_real_escape_string($sRating); - $iNumApps = mysql_real_escape_string($iNumApps); + $sRating = query_escape_string($sRating); + $iNumApps = query_escape_string($iNumApps); /* list of versionIds we've already output, so we don't output */ /* them again when filling in any empty spots in the list */ @@ -331,8 +331,8 @@ function outputTopXRowAppsFromRating($sRating, $iNumApps) ORDER BY c DESC LIMIT ?"; $hResult = query_parameters($sQuery, $sRating, $iNumApps); - $iNumApps -= mysql_num_rows($hResult); /* take away the rows we are outputting here */ - while($oRow = mysql_fetch_object($hResult)) + $iNumApps -= query_num_rows($hResult); /* take away the rows we are outputting here */ + while($oRow = query_fetch_object($hResult)) { /* keep track of the apps we've already output */ $aVersionId[] = $oRow->versionId; @@ -358,7 +358,7 @@ function outputTopXRowAppsFromRating($sRating, $iNumApps) /* get the list that will fill the empty spots */ $hResult = query_appdb($sQuery); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) outputTopXRow($oRow); } @@ -457,13 +457,13 @@ function searchForApplication($search_words) $sQuery = "SELECT vendorId from vendor where vendorName LIKE '%?%' OR vendorURL LIKE '%?%'"; $hResult = query_parameters($sQuery, $value, $value); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { array_push($vendorIdArray, $oRow->vendorId); } } - $search_words = str_replace(' ', '%', mysql_real_escape_string($search_words)); + $search_words = str_replace(' ', '%', query_escape_string($search_words)); /* base query */ $sQuery = "SELECT * @@ -477,7 +477,7 @@ function searchForApplication($search_words) /* append to the query any vendors that we matched with */ foreach($vendorIdArray as $key=>$value) { - $sQuery.=" OR appFamily.vendorId=".mysql_real_escape_string($value); + $sQuery.=" OR appFamily.vendorId=".query_escape_string($value); } $sQuery.=" ) ORDER BY appName"; @@ -497,7 +497,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent) /* add on all of the like matches that we can find */ $hResult = searchForApplication($search_words); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { array_push($excludeAppIdArray, $oRow->appId); } @@ -506,7 +506,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent) $sQuery = "SELECT appName, appId FROM appFamily WHERE queued = 'false'"; foreach ($excludeAppIdArray as $key=>$value) { - $sQuery.=" AND appId != '".mysql_real_escape_string($value)."'"; + $sQuery.=" AND appId != '".query_escape_string($value)."'"; } $sQuery.=";"; @@ -514,7 +514,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent) $search_words = strtoupper($search_words); $hResult = query_appdb($sQuery); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oRow->appName = strtoupper($oRow->appName); /* convert the appname to upper case */ similar_text($oRow->appName, $search_words, $similarity_pst); @@ -535,11 +535,11 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent) { if($firstEntry == true) { - $sQuery.="appId='".mysql_real_escape_string($value)."'"; + $sQuery.="appId='".query_escape_string($value)."'"; $firstEntry = false; } else { - $sQuery.=" OR appId='".mysql_real_escape_string($value)."'"; + $sQuery.=" OR appId='".query_escape_string($value)."'"; } } $sQuery.=" ORDER BY appName;"; @@ -550,7 +550,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent) function outputSearchTableForhResult($search_words, $hResult) { - if(($hResult == null) || (mysql_num_rows($hResult) == 0)) + if(($hResult == null) || (query_num_rows($hResult) == 0)) { // do something echo html_frame_start("","98%"); @@ -568,7 +568,7 @@ function outputSearchTableForhResult($search_words, $hResult) echo "\n\n"; $c = 0; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oApp = new application($oRow->appId); //skip if a NONAME @@ -580,7 +580,7 @@ function outputSearchTableForhResult($search_words, $hResult) //count versions $hResult2 = query_parameters("SELECT count(*) as versions FROM appVersion WHERE appId = '?' AND versionName != 'NONAME' and queued = 'false'", $oRow->appId); - $y = mysql_fetch_object($hResult2); + $y = query_fetch_object($hResult2); //display row echo "\n"; diff --git a/include/vendor.php b/include/vendor.php index 82266b1..41105d8 100644 --- a/include/vendor.php +++ b/include/vendor.php @@ -31,7 +31,7 @@ class Vendor { FROM vendor WHERE vendorId = '?'"; if($hResult = query_parameters($sQuery, $iVendorId)) - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); } if($oRow) @@ -50,7 +50,7 @@ class Vendor { WHERE vendorId = '?'"; if($hResult = query_parameters($sQuery, $this->iVendorId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $this->aApplicationsIds[] = $oRow->appId; } @@ -71,9 +71,9 @@ class Vendor { /* Check for duplicates */ $hResult = query_parameters("SELECT * FROM vendor WHERE vendorName = '?'", $this->sName); - if($hResult && $oRow = mysql_fetch_object($hResult)) + if($hResult && $oRow = query_fetch_object($hResult)) { - if(mysql_num_rows($hResult)) + if(query_num_rows($hResult)) { $this->vendor($oRow->vendorId); @@ -89,7 +89,7 @@ class Vendor { $this->mustBeQueued() ? "true" : "false"); if($hResult) { - $this->iVendorId = mysql_insert_id(); + $this->iVendorId = query_appdb_insert_id(); $this->vendor($this->iVendorId); return true; } @@ -355,7 +355,7 @@ class Vendor { if(!$hResult) return FALSE; - if(!$oRow = mysql_fetch_object($hResult)) + if(!$oRow = query_fetch_object($hResult)) return FALSE; return $oRow->count; diff --git a/include/version.php b/include/version.php index cc6115b..3f4f75c 100644 --- a/include/version.php +++ b/include/version.php @@ -55,7 +55,7 @@ class version { FROM appVersion WHERE versionId = '?'"; if($hResult = query_parameters($sQuery, $iVersionId)) - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); } if($oRow) @@ -96,7 +96,7 @@ class version { if($hResult) { - $this->iVersionId = mysql_insert_id(); + $this->iVersionId = query_appdb_insert_id(); $this->Version($this->iVersionId); $this->SendNotificationMail(); @@ -226,7 +226,7 @@ class version { WHERE versionId = '?'"; if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aNotesIds[] = $oRow->noteId; } @@ -247,7 +247,7 @@ class version { WHERE versionId = '?'"; if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aCommentsIds[] = $oRow->commentId; } @@ -269,7 +269,7 @@ class version { if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { if($oRow->type="image") $aScreenshotsIds[] = $oRow->id; @@ -307,7 +307,7 @@ class version { ORDER BY testingId"; if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aTestingIds[] = $oRow->testingId; } @@ -328,7 +328,7 @@ class version { ORDER BY monitorId"; if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aMonitorIds[] = $oRow->monitorId; } @@ -391,9 +391,9 @@ class version { appMaintainers WHERE userId = '?' AND versionId = '?'", $this->iSubmitterId, $this->iVersionId); - if($hResultMaint && mysql_num_rows($hResultMaint)) + if($hResultMaint && query_num_rows($hResultMaint)) { - $oMaintainerRow = mysql_fetch_object($hResultMaint); + $oMaintainerRow = query_fetch_object($hResultMaint); $oMaintainer = new Maintainer($oMaintainerRow->maintainerId); $oMaintainer->unQueue("OK"); } @@ -569,7 +569,7 @@ class version { ORDER BY bug_id"; if($hResult = query_parameters($sQuery, $this->iVersionId)) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aBuglinkIds[] = $oRow->linkId; } @@ -1014,7 +1014,7 @@ class version { $hNotes = query_parameters("SELECT noteId FROM appNotes WHERE versionId = '?'", $this->iVersionId); - while( $oRow = mysql_fetch_object($hNotes) ) + while( $oRow = query_fetch_object($hNotes) ) { $oNote = new Note($oRow->noteId); $oNote->display(); @@ -1029,9 +1029,9 @@ class version { if(!$versionId) return null; $result = query_parameters("SELECT versionName FROM appVersion WHERE versionId = '?'", $versionId); - if(!$result || mysql_num_rows($result) != 1) + if(!$result || query_num_rows($result) != 1) return null; - $ob = mysql_fetch_object($result); + $ob = query_fetch_object($result); return $ob->versionName; } @@ -1046,10 +1046,10 @@ class version { AND versionId = '?'", $iVersionId); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) return FALSE; - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); return "$oRow->appName $oRow->versionName"; } @@ -1183,7 +1183,7 @@ class version { $hResult = Maintainer::getMaintainersForAppIdVersionId(null, $this->iVersionId); $iCount = 0; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $aMaintainers[$iCount] = $oRow->userId; $iCount++; @@ -1197,7 +1197,7 @@ class version { { $hResult = query_parameters("SELECT appFamily.appName, appVersion.versionName, appVersion.description, appVersion.versionId, appVersion.submitTime FROM appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND appVersion.submitterId = '?' AND appVersion.queued = '?' AND appFamily.queued = '?'", $iUserId, $bQueued ? "true" : "false", "false"); - if(!$hResult || !mysql_num_rows($hResult)) + if(!$hResult || !query_num_rows($hResult)) return false; $oTable = new Table(); @@ -1212,7 +1212,7 @@ class version { $oTableRow->SetClass("color4"); $oTable->SetHeader($oTableRow); - for($i = 1; $oRow = mysql_fetch_object($hResult); $i++) + for($i = 1; $oRow = query_fetch_object($hResult); $i++) { $oTableRow = new TableRow(); $oTableRow->AddTextCell(version::fullNameLink($oRow->versionId)); @@ -1343,7 +1343,7 @@ class version { if(!$hResult) return FALSE; - if(!$oRow = mysql_fetch_object($hResult)) + if(!$oRow = query_fetch_object($hResult)) return FALSE; return $oRow->count; @@ -1546,7 +1546,7 @@ class version { if(!$hResult) return FALSE; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oTestData = new testData($oRow->testingId); $oTestData->iVersionId = $iNewId; @@ -1563,7 +1563,7 @@ class version { if(!$hResult) return FALSE; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oAppData = new appData($oRow->testingId); $oAppData->iVersionId = $iNewId; diff --git a/include/version_queue.php b/include/version_queue.php index de3a0ed..6f625e1 100644 --- a/include/version_queue.php +++ b/include/version_queue.php @@ -27,7 +27,7 @@ class version_queue $hResult = appData::getData($iVersionId, "downloadurl", TRUE, TRUE, TRUE)) { - if($oRow = mysql_fetch_object($hResult)) + if($oRow = query_fetch_object($hResult)) $iDownloadUrlId = $oRow->id; } } diff --git a/include/vote.php b/include/vote.php index 506cbd1..cf3d9ec 100644 --- a/include/vote.php +++ b/include/vote.php @@ -17,7 +17,7 @@ function vote_count($iVersionId, $iUserId = null) } $hResult = query_parameters("SELECT * FROM appVotes WHERE versionId = '?' AND userId = '?'", $iVersionId, $iUserId); - return mysql_num_rows($hResult); + return query_num_rows($hResult); } @@ -34,7 +34,7 @@ function vote_count_user_total($iUserId = null) return 0; } $hResult = query_parameters("SELECT * FROM appVotes WHERE userId = '?'", $iUserId); - return mysql_num_rows($hResult); + return query_num_rows($hResult); } @@ -45,7 +45,7 @@ function vote_count_version_total($iVersionId) { $hResult = query_parameters("SELECT * FROM appVotes WHERE versionId = '?'", $iVersionId); - return mysql_num_rows($hResult); + return query_num_rows($hResult); } @@ -105,7 +105,7 @@ function vote_get_user_votes($iUserId = null) return array(); $obs = array(); - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) $obs[$oRow->slot] = $oRow; return $obs; } @@ -198,7 +198,7 @@ function is_vote_in_slot($iSlot, $iUserId = null) $sQuery = "SELECT COUNT(*) as count from appVotes WHERE userId = '?' AND slot = '?'"; if($hResult = query_parameters($sQuery, $iUserId, $iSlot)) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow->count != 0) return true; else diff --git a/index.php b/index.php index 9888e16..5ead491 100644 --- a/index.php +++ b/index.php @@ -62,7 +62,7 @@ if(!$_SESSION['current']->isLoggedIn()) "FROM appVotes ". "GROUP BY versionId ORDER BY count DESC LIMIT 1"; $hResult = query_parameters($voteQuery); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); echo "There are $iNumApps applications currently in the database"; diff --git a/preferences.php b/preferences.php index 13d773d..743cff9 100644 --- a/preferences.php +++ b/preferences.php @@ -32,7 +32,7 @@ function build_prefs_list($oUser) $aTableRows = array(); $hResult = query_parameters("SELECT * FROM prefs_list ORDER BY id"); - while($hResult && $r = mysql_fetch_object($hResult)) + while($hResult && $r = query_fetch_object($hResult)) { // skip admin options if(!$_SESSION['current']->hasPriv("admin")) diff --git a/screenshots.php b/screenshots.php index 042f783..dd47c40 100644 --- a/screenshots.php +++ b/screenshots.php @@ -60,7 +60,7 @@ apidb_header("Screenshots"); $oApp = new Application($aClean['iAppId']); $oVersion = new Version($aClean['iVersionId']); -if($hResult && mysql_num_rows($hResult)) +if($hResult && query_num_rows($hResult)) { echo html_frame_start("Screenshot Gallery for ".$oApp->sName." ".$oVersion->sName,500); @@ -72,7 +72,7 @@ if($hResult && mysql_num_rows($hResult)) $bUserIsMaintainerOfVersion = false; echo "
\n"; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { // if the current version changed then update the current version // and close the previous html frame if this isn't the diff --git a/unit_test/run_tests.php b/unit_test/run_tests.php index 5a60378..74ec659 100644 --- a/unit_test/run_tests.php +++ b/unit_test/run_tests.php @@ -117,7 +117,7 @@ class table_counts { $sQuery = "select count(*) as cnt from ?;"; $hResult = query_parameters($sQuery, $sTable); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $this->aTableCounts[] = $oRow->cnt; } diff --git a/unit_test/test_application.php b/unit_test/test_application.php index 91c8571..d899480 100644 --- a/unit_test/test_application.php +++ b/unit_test/test_application.php @@ -62,7 +62,7 @@ function test_application_delete() if($hResult = query_parameters($sQuery, $iAppId)) { - $iRows = mysql_num_rows($hResult); + $iRows = query_num_rows($hResult); if($iRows > 0) { echo "Found '".$iRows."' versions for this application left over!"; diff --git a/unit_test/test_maintainer.php b/unit_test/test_maintainer.php index 57cf435..1332f88 100644 --- a/unit_test/test_maintainer.php +++ b/unit_test/test_maintainer.php @@ -555,7 +555,7 @@ function test_maintainer_getMaintainersForAppIdVersionId() /* The application should have one maintainer */ $iExpected = 1; - $iReceived = mysql_num_rows($hResult); + $iReceived = query_num_rows($hResult); if($iExpected != $iReceived) { error("Got super maintainer count of $iReceived instead of $iExpected!"); @@ -575,7 +575,7 @@ function test_maintainer_getMaintainersForAppIdVersionId() /* The version should have one maintainer */ $iExpected = 1; - $iReceived = mysql_num_rows($hResult); + $iReceived = query_num_rows($hResult); if($iExpected != $iReceived) { error("Got maintainer count of $iReceived instead of $iExpected!"); @@ -614,7 +614,7 @@ function test_maintainer_getMaintainersForAppIdVersionId() /* The first version should have one maintainer */ $iExpected = 1; - $iReceived = mysql_num_rows($hResult); + $iReceived = query_num_rows($hResult); if($iExpected != $iReceived) { error("Got maintainer count of $iReceived instead of $iExpected!"); @@ -634,7 +634,7 @@ function test_maintainer_getMaintainersForAppIdVersionId() /* The second version should have 1 maintainer */ $iExpected = 1; - $iReceived = mysql_num_rows($hResult); + $iReceived = query_num_rows($hResult); if($iExpected != $iReceived) { error("Got maintainer count of $iReceived instead of $iExpected!"); diff --git a/unit_test/test_maintainer_notify.php b/unit_test/test_maintainer_notify.php index 05261c4..1edbae1 100644 --- a/unit_test/test_maintainer_notify.php +++ b/unit_test/test_maintainer_notify.php @@ -130,7 +130,7 @@ class notifyContainer { $sQuery2 = "select * from appMaintainers where maintainerId = '?'"; $hResult = query_parameters($sQuery2, $this->oMaintainer->iMaintainerId); - $oObject = mysql_fetch_object($hResult); + $oObject = query_fetch_object($hResult); print_r($oObject); } @@ -317,7 +317,7 @@ function test_maintainer_notifyLevel_2_to_3($bTestAsMaintainer) // check to make sure the maintainer doesn't exist $sQuery = "select count(*) as cnt from appMaintainers where maintainerId = '?'"; $hResult = query_parameters($sQuery, $oNotifyContainer->oMaintainer->iMaintainerId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($oRow->cnt != 0) { $bSuccess = false; diff --git a/unit_test/test_om_objects.php b/unit_test/test_om_objects.php index 0655c99..06ad4b2 100644 --- a/unit_test/test_om_objects.php +++ b/unit_test/test_om_objects.php @@ -54,15 +54,15 @@ function test_class($sClassName, $aTestMethods) if(!$hResult) { - error("Got '$hResult' instead of a valid MySQL handle"); + error("Got '$hResult' instead of a valid query handle"); error("FAILED\t\t$sClassName::$sClassName"); $oTestObject->delete(); return FALSE; } - if(!($oRow = mysql_fetch_object($hResult))) + if(!($oRow = query_fetch_object($hResult))) { - error("Failed to fetch MySQL object"); + error("Failed to fetch query object"); error("FAILED\t\t$sClassName::$sClassName"); $oTestObject->delete(); return FALSE; @@ -111,7 +111,7 @@ function test_class($sClassName, $aTestMethods) /* Should return 1 or more, since there may be entries present already */ $iExpected = 1; $hResult = $oTestObject->objectGetEntries(false, false); - $iReceived = mysql_num_rows($hResult); + $iReceived = query_num_rows($hResult); if($iExpected > $iReceived) { error("Got $iReceived instead of >= $iExpected"); @@ -223,7 +223,7 @@ function create_object($sClassName, $oUser) error("FAILED\t\t$sClassName to create screenshot entry"); return FALSE; } - $oTestObject->iScreenshotId = mysql_insert_id(); + $oTestObject->iScreenshotId = query_appdb_insert_id(); } return $oTestObject; diff --git a/unit_test/test_query.php b/unit_test/test_query.php index 69e89de..4ff08af 100644 --- a/unit_test/test_query.php +++ b/unit_test/test_query.php @@ -30,7 +30,7 @@ function test_query_parameters() return false; } - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $iUserCount = $oRow->count; /* see that '~' strings are replaced with parameters */ @@ -41,7 +41,7 @@ function test_query_parameters() $hResult = query_parameters($sQuery, "user_list", "1' OR 1='1"); if($hResult) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($iUserCount != $oRow->count) { echo "sQuery of '".$sQuery."' returned ".$oRow->count." entries instead of the expected ".$iUserCount."\n"; @@ -88,7 +88,7 @@ function test_query_parameters() * properly with slashes in the query, they were incorrectly being recognized * as tokens that should be replaced with parameters */ - $sQuery = "SELECT count(*) as count, '".mysql_real_escape_string("\r\n")."' as x from ?"; + $sQuery = "SELECT count(*) as count, '".query_escape_string("\r\n")."' as x from ?"; $hResult = query_parameters($sQuery, "user_list"); if(!$hResult) { diff --git a/unit_test/test_user_password_migration.php b/unit_test/test_user_password_migration.php index af05b2e..78c1c3c 100644 --- a/unit_test/test_user_password_migration.php +++ b/unit_test/test_user_password_migration.php @@ -19,13 +19,13 @@ function test_user_password_migration() // generate the SHA1() of the users password $sQuery = "select SHA1('?') as password;"; $hResult = query_parameters($sQuery, $sTestPassword); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $sTestUserPasswordSHA1 = $oRow->password; // test that the user was created with the sha1 hash of their password $sQuery = "select password from user_list where userid = '?';"; $hResult = query_parameters($sQuery, $oUser->iUserId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($sTestUserPasswordSHA1 != $oRow->password) { error("sTestUserPasswordSHA1 $sTestUserPasswordSHA1 doesn't match oRow->password of $oRow->password after user::create()"); @@ -56,7 +56,7 @@ function test_user_password_migration() // after the user was logged in $sQuery = "select password from user_list where userid = '?';"; $hResult = query_parameters($sQuery, $oUser->iUserId); - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); if($sTestUserPasswordSHA1 != $oRow->password) { error("sTestUserPasswordSHA1 $sTestUserPasswordSHA1 doesn't match oRow->password of $oRow->password"); diff --git a/viewScreenshots.php b/viewScreenshots.php index a69a8b0..474cc78 100644 --- a/viewScreenshots.php +++ b/viewScreenshots.php @@ -59,7 +59,7 @@ echo ""; $Ids = appData::objectGetEntries(false, false, $ItemsPerPage, $offset, "screenshot"); $c = 1; echo "
\n"; -while ($oRow = mysql_fetch_object($Ids)) +while ($oRow = query_fetch_object($Ids)) { // display thumbnail $oVersion = new version($oRow->versionId); diff --git a/viewbugs.php b/viewbugs.php index 9b1dcfc..dcb0c9f 100644 --- a/viewbugs.php +++ b/viewbugs.php @@ -42,14 +42,14 @@ if(!is_numeric($aClean['iBugId'])) if($hResult) { - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $oApp = new application($oRow->appId); $oVersion = new version($oRow->versionId); $sDownloadUrls = ""; if($hDownloadUrls = appData::getData($oRow->versionId, "downloadurl")) { - while($oDownloadUrl = mysql_fetch_object($hDownloadUrls)) + while($oDownloadUrl = query_fetch_object($hDownloadUrls)) $sDownloadUrls .= "url\">". "$oDownloadUrl->description
"; } diff --git a/votestats.php b/votestats.php index 8fdb8a9..7d436bf 100644 --- a/votestats.php +++ b/votestats.php @@ -56,7 +56,7 @@ if(!empty($aClean['iCategoryId'])) if($hResult) { - $oRow = mysql_fetch_object($hResult); + $oRow = query_fetch_object($hResult); $catParent = $oRow->catParent; array_push($cat_array, "$currentCatId"); @@ -174,7 +174,7 @@ if($hResult) $oTable->AddRow($oTableRow); $c = 1; - while($oRow = mysql_fetch_object($hResult)) + while($oRow = query_fetch_object($hResult)) { $sColor = ($c % 2) ? "color0" : "color1";