Jump to content

mkdir is not working


takn25

Recommended Posts

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);   

Link to comment
https://forums.phpfreaks.com/topic/231296-mkdir-is-not-working/
Share on other sites

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);

 

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.