Jump to content

hi there


cybernet

Recommended Posts

i want to create a php page that will delete more files ( depends on mysql "answer" )

 

so at this query

 

$torrents_2_delete=("SELECT info_hash

FROM `cfn_l_files`

WHERE `external` = 'yes'

AND `announce_url` LIKE '%piratebay%'")

 

i get an answer like this

 

info_hash

740577b8f3cf5aac365eeb95aafde8d753996265

4f7a5b7a9e6da8cc57f7f2b533133835045579e1

2606684a4892db35ac6fbd8868e2b7e75e6b5dd3

d5001218013aecd80d8c670bb17b276172d1fb21

e6876558aac41c864bc53ee66229119910d42d53

 

 

etc etc etc .... ( about 600 values )

 

 

$delete_those = mysql_*($torrents_2_delete);

the part i don't know is

what php function do i use to fetch the results

*what comes there :wtf:

then the final part

unlink($TORRENTSDIR."/$delete_those.btf");

 

 

i hope you understand what i meant

Link to comment
https://forums.phpfreaks.com/topic/175343-hi-there/
Share on other sites

$torrents_2_delete= mysql_query("
                     SELECT info_hash
                     FROM `cfn_l_files`
                     WHERE `external` = 'yes'
                     AND `announce_url` 
                     LIKE '%piratebay%'") or trigger_error(mysql_error());

if($torrents_2_delete){ //if query didn't fail
       
       //loop through result set
       while($row = mysql_fetch_assoc($torrents_2_delete)){
               echo $row['info_hash'].'<br />';
               //or do whatever
       }
       if(mysql_num_rows($torrents_2_delete) == 0){
               echo 'None found';
       }

}

 

Link to comment
https://forums.phpfreaks.com/topic/175343-hi-there/#findComment-924048
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.