herghost Posted April 16, 2009 Share Posted April 16, 2009 Hi all, I thought this would be simple, silly me! All I am trying to do is create a directory on the server with the same name as the userid from my database: <?php session_start(); include('../include/database.php'); $query = "SELECT * FROM user WHERE userid = 4"; $result = mysql_query($query) or die(mysql_error()); if ($result) { while ($r = mysql_fetch_array($result)) { { $userid = $r["userid"]; } } } mkdir('./users/'.$userid); ?> However, I get no errors when it runs, but no directory is made either! The file structure for the files is like so root->folder->above file and I want to create the folder like so root->users>createfolderhere The folder users already exists and is CHMOD 777 Any ideas? Link to comment https://forums.phpfreaks.com/topic/154399-solved-mkdir-help/ Share on other sites More sharing options...
herghost Posted April 16, 2009 Author Share Posted April 16, 2009 damn got it! mkdir('./users/'.$userid); should be mkdir('../users/'.$userid); Link to comment https://forums.phpfreaks.com/topic/154399-solved-mkdir-help/#findComment-811834 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.