[Freerealty] Another problem - deleting images..

Scott Wang scott at scottscomputing.com
Sun May 1 13:38:06 MST 2005


When I delete a listing I get this error:


Listing #8 has been removed...
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in
/home/httpd/vhosts/woodedland.com/httpdocs/listings/admin/admin.php on line
64

Warning:
unlink(/home/httpd/vhosts/woodedland.com/httpdocs/listings/pictures/listings
/_): No such file or directory in
/home/httpd/vhosts/woodedland.com/httpdocs/listings/admin/admin.php on line
65

Warning:
unlink(/home/httpd/vhosts/woodedland.com/httpdocs/listings/pictures/listings
/_thumb_): No such file or directory in
/home/httpd/vhosts/woodedland.com/httpdocs/listings/admin/admin.php on line
66
Images for property #8 have also been removed...  

--------------------------
This is the code I have in admin.php that does the deleting (I didn't change
anything from the original)
--------------------------

//DELETE A RECORD

if (isset($delete) && $delete != "")
{
 $query = "delete from ".$table_prefix."homes_features where ref_homes =
$delete";
 mysql_query ($query, $link);
 $query = "DELETE FROM ".$table_prefix."homes WHERE (id = '$delete')";
 if (!mysql_query ($query, $link) )
 {
  die (mysql_error());
 }
 print "Listing #$delete has been removed...";
  if (isset($images_use) && $images_use == "folders"  )
 {
  //Get the image information....
  $sql = "select id_files, filename from ".$table_prefix."tbl_Files where
id_files = $deleteimage ";
  $image_query = mysql_query($sql, $link);
Line 64 -->  $image_result = mysql_fetch_array($image_query);
  unlink
("$install_path/$imageloc/listings/$image_result[id_files]"."_"."$image_resu
lt[filename]"); 
  unlink
("$install_path/$imageloc/listings/$image_result[id_files]"."_"."thumb"."_".
"$image_result[filename]"); 
  
 }

 $query = "DELETE FROM ".$table_prefix."tbl_Files WHERE (prop_num =
'$delete')";
 
 if (!mysql_query ($query, $link) )
 {
  die (mysql_error());
 }
 print "Images for property #$delete have also been removed...";

------------------------------

The listing itself gets deleted just fine, but the images do not get
deleted.  I do have the images folder set to 777 so permissions shouldn't be
a problem.  



 - Scott Wang
Scott's Computing
P.O. Box 472   Thorp, WI 54771
Office:  715-669-5412   Fax: 715-669-5413
Email: scott at scottscomputing.com
 
 
 

-----Original Message-----
From: freerealty-bounces at lists.rwcinc.net
[mailto:freerealty-bounces at lists.rwcinc.net] On Behalf Of Reply_To
Sent: Wednesday, April 27, 2005 10:48 AM
To: Continuation of Jon Roig's OR 2.x Development
Subject: Re: [Freerealty] featured.php missing database name?


OK. However, I have configured my server to record all of them and sort
based on file type, etc.

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> The errors for the image files have to be "searched for" in that you
> normally just get a link where the image should have been. Only by right
> clicking the image link and selecting view image will you see the actual
> error. And it will be a mysql error in most instances.
> 
> Reply_To wrote:
> | Try looking at your error page(s). A 404 should be given for all errors,
> | unless your configuration does not provide this info...
> |
> |
> |>Actually... I wonder if that's the problem.  My index file (where
featured
> |>listings are shown) is in the root directory while the FreeRealty
> files are
> |>in the /listings/ directory.
> |>
> |>Is it possible that it was looking for root/includes/func.php while
> the file
> |>was really located at root/listings/includes/func.php ?
> |>
> |>- Scott Wang
> |>Scott's Computing
> |
> |
> | _______________________________________________
> | FreeRealty mailing list
> | FreeRealty at lists.rwcinc.net
> | http://lists.rwcinc.net/mailman/listinfo/freerealty
> | FreeRealty web site: http://www.rwcinc.net/freerealty
> |
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (Cygwin)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFCb7MMGzHR7DxVKWIRAgfvAJoCXt1SPmbw72GDCERZ7HC/39AVYgCfXm4i
> /YEejmOuyMou1xAszXpfFoI=
> =eYBj
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> FreeRealty mailing list
> FreeRealty at lists.rwcinc.net
> http://lists.rwcinc.net/mailman/listinfo/freerealty
> FreeRealty web site: http://www.rwcinc.net/freerealty

_______________________________________________
FreeRealty mailing list
FreeRealty at lists.rwcinc.net
http://lists.rwcinc.net/mailman/listinfo/freerealty
FreeRealty web site: http://www.rwcinc.net/freerealty




More information about the FreeRealty mailing list