fixing the old project errors

This commit is contained in:
Anas Rashid committed 2026-04-29 00:42:13 +02:00
1 parent 34753111ed
commit 4ff0c03c62
23 files changed
+117 -278

No files matched your search

+10 -10
View File
@@ -9,16 +9,16 @@
public static function getImage($id){
$query="select * from photos where imgId='".$id."'";
$rs = DataAccessHelper::executeQuery($query);
if (sizeof($rs) > 0){
if ($rs && sizeof($rs) > 0){
return $rs;
}
return false;
}
public static function getComments($imgId){
$query='select fullname,commentstr from imgcomments join users on users.username=imgcomments.username where imgId="'.$imgId.'"';
$rs = DataAccessHelper::executeQuery($query);
if (sizeof($rs) > 0){
if ($rs && sizeof($rs) > 0){
return $rs;
}
return false;
@@ -36,16 +36,16 @@
public static function getImageusername($username){
$query="select * from photos where username='".$username."'";
$rs = DataAccessHelper::executeQuery($query);
if ($rs > 0){
if ($rs && sizeof($rs) > 0){
return $rs;
}
return false;
}
public static function getImagePublic(){
$query='select * from photos where shareStatus=1';
$rs = DataAccessHelper::executeQuery($query);
if ($rs > 0)
if ($rs && sizeof($rs) > 0)
{
return $rs;
}
@@ -56,14 +56,15 @@
public static function getShared($username){
$query='select * from sharedto join photos on photos.imgId=sharedto.imgId and sharedto.username="'.$username.'"';
$rs = DataAccessHelper::executeQuery($query);
if (sizeof($rs) > 0){
if ($rs && sizeof($rs) > 0){
return $rs;
}
return false;
}
public static function insertImage($image,$name,$description,$access,$username,$label, $albumId){
$query="insert into photos (name,imageFile,shareStatus,description,username,label, albumId)values('$name','$image','$access','$description','$username','$label','$albumId')";
$albumIdSql = ($albumId === null) ? 'NULL' : "'$albumId'";
$query="insert into photos (name,imageFile,shareStatus,description,username,label, albumId)values('$name','$image','$access','$description','$username','$label',$albumIdSql)";
$rs = DataAccessHelper::insertQuerySpecial($query);
if($rs){
$string = $label;
@@ -71,8 +72,7 @@
while ($token !== false)
{
echo $rs;
$query="insert into imagetags(imgId,str) values('$rs','$token')";
$query="insert into imagetags(imgId,tag) values('$rs','$token')";
DataAccessHelper::insertQuerySpecial($query);
$token = strtok(" ");
}