Jump to content

[SOLVED] mkdir Help


herghost

Recommended Posts

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

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.