sviesc Posted August 3, 2004 Report Share Posted August 3, 2004 tātad ir kods: <? //piekonektejas serverim un datu bazei include("head.db.php"); MYSQL_CONNECT ($hostname,$username,$password) OR DIE ("nav servera"); mysql_select_db("$dbName") or DIE ("Nav DB."); // sākas selects $q = "SELECT * FROM bildes_main WHERE id='$id'"; mysql_query($q) or die (mysql_error()); // cikls if (!$q) { echo( mysql_error()); } else { while ($main_b = mysql_fetch_array($q)) { $bilde_id = $main_b["id"]; $mazabilde = $main_b["bilde"]; $bigz = $main_b["big"]; unlink("mazas/$mazabilde"); unlink("mazas/$bigz"); // lūk arī problemātiskā rinda } } // SQL DB datu izdzēšana $d = "DELETE FROM bildes_main WHERE id='$id'"; mysql_query($d) or die (mysql_error()); ?> problēma ar tajā ka bilde netiek izdzšta( nodzēsta no servera), problēma nebūs ar chmod tas ir uz 777 man ir stupras aizdomas ka art to unlink() kautkas nau kārtībā varbūt me nepareizi šamo izman to :blink: Link to comment Share on other sites More sharing options...
bubu Posted August 3, 2004 Report Share Posted August 3, 2004 LOL :) tev gan nu īsti korekts kods! $q = "SELECT * FROM bildes_main WHERE id='$id'"; ... mysql_fetch_array($q) Kā tu iedomājies, ka mysql izfečos datus no stringa? :) Link to comment Share on other sites More sharing options...
Recommended Posts