這是我想讓它能夠通過用戶名爲用戶創建多個目錄的代碼。如何通過用戶名爲用戶創建多個目錄
現在它由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