remove all mysql_error() instances as errors are handled by query_appdb()
This commit is contained in:
@@ -81,27 +81,20 @@ class Application {
|
||||
|
||||
function deleteAppFamily($appId)
|
||||
{
|
||||
$r = query_appdb("DELETE FROM appFamily WHERE appId = $appId");
|
||||
$r = query_appdb("DELETE FROM appFamily WHERE appId = $appId", "Failed to delete appFamily $appId");
|
||||
if($r)
|
||||
{
|
||||
$r = query_appdb("DELETE FROM appVersion WHERE appId = $appId");
|
||||
$r = query_appdb("DELETE FROM appVersion WHERE appId = $appId", "Failed to delete appVersions");
|
||||
if($r)
|
||||
addmsg("Application and versions deleted", "green");
|
||||
else
|
||||
addmsg("Failed to delete appVersions: " . mysql_error(), "red");
|
||||
}
|
||||
else
|
||||
addmsg("Failed to delete appFamily $appId: " . mysql_error(), "red");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function deleteAppVersion($versionId)
|
||||
{
|
||||
$r = query_appdb("DELETE FROM appVersion WHERE versionId = $versionId");
|
||||
$r = query_appdb("DELETE FROM appVersion WHERE versionId = $versionId","Failed to delete appVersion $versionId");
|
||||
if($r)
|
||||
addmsg("Application Version $versionId deleted", "green");
|
||||
else
|
||||
addmsg("Failed to delete appVersion $versionId: " . mysql_error(), "red");
|
||||
}
|
||||
|
||||
function lookupVersionName($appId, $versionId)
|
||||
|
||||
@@ -211,20 +211,15 @@ function make_cat_path($path, $appId = '', $versionId = '')
|
||||
|
||||
function deleteCategory($catId)
|
||||
{
|
||||
$r = query_appdb("SELECT appId FROM appFamily WHERE catId = $catId");
|
||||
$r = query_appdb("SELECT appId FROM appFamily WHERE catId = $catId","Failed to delete category $catId");
|
||||
if($r)
|
||||
{
|
||||
while($ob = mysql_fetch_object($r))
|
||||
deleteAppFamily($ob->appId);
|
||||
$r = query_appdb("DELETE FROM appCategory WHERE catId = $catId");
|
||||
$r = query_appdb("DELETE FROM appCategory WHERE catId = $catId","Failed to delete category $catId");
|
||||
|
||||
if($r)
|
||||
addmsg("Category $catId deleted", "green");
|
||||
else
|
||||
addmsg("Failed to delete category $catId:".mysql_error(), "red");
|
||||
} else
|
||||
{
|
||||
addmsg("Failed to delete category $catId: ".mysql_error(), "red");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,9 +126,7 @@ class TableVE {
|
||||
function edit($query)
|
||||
{
|
||||
$result = query_appdb($query);
|
||||
if(!$result)
|
||||
echo "Oops: ".mysql_error()."<br>$query<br>\n";
|
||||
$nrows = mysql_num_rows($result);
|
||||
$nrows = mysql_num_rows($result);
|
||||
|
||||
echo "<form method=post action='".$_SERVER['PHP_SELF']."'>\n";
|
||||
|
||||
@@ -457,13 +455,7 @@ class TableVE {
|
||||
|
||||
$update .= " WHERE ".$this->get_id($table)." = $value";
|
||||
|
||||
if(!query_appdb($update))
|
||||
{
|
||||
$thisError = "<p><font color=black><b>Query:</b>: $update</font></p>\n";
|
||||
$thisError .= "<p><font color=red>".mysql_error()."</font></p>";
|
||||
addmsg($thisError,"red");
|
||||
}
|
||||
else
|
||||
if(query_appdb($update))
|
||||
{
|
||||
addmsg("Database Operation Complete!","green");
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class User {
|
||||
"email = '$sEmail' AND ".
|
||||
"password = password('$sPassword')");
|
||||
if(!$result)
|
||||
return "Error: ".mysql_error();
|
||||
return "A database error occured";
|
||||
|
||||
if(mysql_num_rows($result) == 0)
|
||||
return "Invalid e-mail or password";
|
||||
@@ -122,11 +122,8 @@ class User {
|
||||
$sFields = "({$aInsert['FIELDS']}, `password`, `stamp`, `created`)";
|
||||
$sValues = "({$aInsert['VALUES']}, password('".$sPassword."'), NOW(), NOW() )";
|
||||
|
||||
if (!query_appdb("INSERT INTO user_list $sFields VALUES $sValues"))
|
||||
{
|
||||
return mysql_error();
|
||||
}
|
||||
return $this->restore($sEmail, $sPassword);
|
||||
query_appdb("INSERT INTO user_list $sFields VALUES $sValues", "Error while creating a new user.");
|
||||
$this->restore($sEmail, $sPassword);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +173,7 @@ class User {
|
||||
$result = query_appdb("DELETE FROM user_list WHERE email = '$sEmail'");
|
||||
|
||||
if(!$result)
|
||||
return mysql_error();
|
||||
return "A database error occured";
|
||||
if(mysql_affected_rows($result) == 0)
|
||||
return "No such user.";
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user