note 50845 added to function.rename
| From: | FelipeMeyer at osu1 dot php dot net | Date: | Fri, 11 Mar 2005 12:46:47 +0000 |
| Subject: | note 50845 added to function.rename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86248@lists.php.net to get a copy of this message | ||
This script can work too renaming the directory. For example, if you want to rename a directory
using numbers and not names you can do like this:
$dir = "./files/";
$query = "SELECT id FROM table WHERE field=\"$field\";\n";
$res = mysql_query($query);
list($id) = mysql_fetch_row($res);
if ($id != "") {
rename("$dir/$field", "$dir/$id");
}
----
Manual Page -- http://www.php.net/manual/en/function.rename.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50845
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50845&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50845&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50845&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50845&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50845&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50845&report=yes
Search -- http://master.php.net/manage/user-notes.php