Jump to content

Jorman

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Jorman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Brackets removed, uploaded en tested...still same error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/test/cms/delete.php on line 31
  2. Thnx for the quick reply!! i understand what you mean, and i have put the code in my page... this is the error i recieve Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/test/cms/delete.php on line 31 Warning: closedir(): supplied argument is not a valid Directory resource in /var/www/html/test/cms/delete.php on line 37 And this is my code... -------------------------- <?php if ($delete == "yes") { mysql_query("DELETE FROM producten WHERE prodid=($productid)"); $result2=mysql_query("SELECT * FROM productfotos WHERE prodid=($prodid)"); $num = mysql_num_rows($result2); for($i=0;$i<$num;$i++) { $filename = mysql_result($result,$i,"filename"); unlink($dh.'/'.$filename); } closedir($dh); mysql_query("DELETE FROM productfotos WHERE prodid=($productid)"); ?> <b><font color="white">Het product is verwijderd!</font></b><br /> <input type=button value="Window Sluiten" onClick="javascript:opener.location.reload(true);self.close();"> <?php } else { ?>
  3. Hi All, I am not a die-hard php programmer, and ik cannot get this script to work... i have searched this forum and the web, but cannot find exactly what i need. I have made a website with an easy to use CMS. The problem is that when i delete a product, i already achieved to remove the database entry (product and photos) BUT i would like te delete the real image files also... this is what i have got so far.... what am i doing wrong? <?php if ($delete == "yes") { mysql_query("DELETE FROM producten WHERE prodid=($productid)"); $result2=mysql_query("SELECT * FROM productfotos WHERE prodid=($prodid)"); $filedir = '/var/www/html/test/images/productfotos'; $dh = opendir($filedir); unlink($dh.'/'.$result2); closedir($dh); mysql_query("DELETE FROM productfotos WHERE prodid=($productid)"); ?> <b><font color="white">Het product is verwijderd!</font></b><br /> <input type=button value="Window Sluiten" onClick="javascript:opener.location.reload(true);self.close();"> <?php } else { ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.