SkyRanger Posted January 23, 2013 Share Posted January 23, 2013 (edited) I am trying to delete files but not sure why this is not working. while($row = $result->fetch_assoc()){ $file1 = $row['pic']; $file2 = $row['pic2']; $file3 = $row['pic3']; } echo $loggedin; echo $file1; echo $file2; echo $file4; unlink('members/$loggedin/inventory/$file1'); unlink('members/$loggedin/inventory/$file2'); unlink('members/$loggedin/inventory/$file3'); All of the echo's display the proper info but I get the error Warning: unlink(members/$loggedin/inventory/$file1) Warning: unlink(members/$loggedin/inventory/$file2) Warning: unlink(members/$loggedin/inventory/$file3) Edited January 23, 2013 by SkyRanger Quote Link to comment https://forums.phpfreaks.com/topic/273561-deleting-file/ Share on other sites More sharing options...
BagoZonde Posted January 23, 2013 Share Posted January 23, 2013 Wrong use of quotations, there's a big difference between " and ' marks. You should check this regarding to using variables inside. Quote Link to comment https://forums.phpfreaks.com/topic/273561-deleting-file/#findComment-1407796 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.