这是我想让它能够通过用户名为用户创建多个目录的代码。如何通过用户名为用户创建多个目录
现在它由big
<?php
$db = new PDO("..."); // Connection details here
$stmt = $db->prepare("SELECT * from some_table where user_id = :id"); // Finds the information based on an ID. Change this depending on how you want the select to work
$stmt->execute(array(':id' => "1")); // Gives value to :id and executes the statement
$row = $stmt->fetch();
// Then run your code
if (!file_exists(ROOT_PATH.'user/upload/'.$row['UserName'].'/avatar/big')) {
mkdir(ROOT_PATH.'user/upload/'.$row['UserName'].'/avatar/big', 0777, true);
}
?>
名称创建我想其他两个目录来这样一个文件夹:
user/upload/'.$row['UserName'].'/avatar/small
user/upload/'.$row['UserName'].'/avatar/original
只是不。老实说:不。真的......虽然这是可能的,但你真的不应该想到梦想着走这条道路。有龙... – 2014-09-22 09:53:25