cybernet Posted September 24, 2009 Share Posted September 24, 2009 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 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 More sharing options...
trq Posted September 24, 2009 Share Posted September 24, 2009 You use a combination of mysql_query and mysql_fetch_assoc to fetch data from a mysql database. Link to comment https://forums.phpfreaks.com/topic/175343-hi-there/#findComment-924043 Share on other sites More sharing options...
cybernet Posted September 24, 2009 Author Share Posted September 24, 2009 thanks a lot i forgot to put in the post mysql_query near ("SELECT info_hash Link to comment https://forums.phpfreaks.com/topic/175343-hi-there/#findComment-924045 Share on other sites More sharing options...
waynew Posted September 24, 2009 Share Posted September 24, 2009 $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 More sharing options...
cybernet Posted September 24, 2009 Author Share Posted September 24, 2009 how do i put in the same file a form on submit i wan't those queries to be executed something like waynewex said and by the way thanks you waynewex cybernet Link to comment https://forums.phpfreaks.com/topic/175343-hi-there/#findComment-924075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.