takn25 Posted March 21, 2011 Share Posted March 21, 2011 Hi, I want to create a folder for every auto incrementing row so I used this $id=mysql_insert_id(); mkdir("../Setting/time/".$id); I am getting an error Warning: mkdir() [function.mkdir]: No such file or directory in C:\xampp\htdocs\Setting\time\index.php I have used the mkdir function in this similar method before there was no problem. For some reason it is not working now. If I just try it on a blank page example the following method seems to work could some one point to me what I might be doing wrong? $tid=1; mkdir("../Setting/time/".$tid); Quote Link to comment https://forums.phpfreaks.com/topic/231296-mkdir-is-not-working/ Share on other sites More sharing options...
xangelo Posted March 21, 2011 Share Posted March 21, 2011 Most likely the path you are passing to mkdir does not actually point to the location you're trying to create the file in. Since you're calling mkdir from Setting/time/index.php it looks like you want to create the folder IN that directory. Try: mkdir('./'.$id); or use the following to see where exactly you are creating that new directory. mkdir("../Setting/time/".$id,0,true); Quote Link to comment https://forums.phpfreaks.com/topic/231296-mkdir-is-not-working/#findComment-1190463 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.