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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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