summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-06-05 12:13:23 +0000
committerDries Buytaert <dries@buytaert.net>2007-06-05 12:13:23 +0000
commit27388f66557cddce6aff1cc945601c5f843304cd (patch)
tree3a12f2afdc14b5af5be1b03d9c1fde6ac3d77928 /includes/file.inc
parent745222200e0670f55c6d695e467558171b7bb5d8 (diff)
downloadbrdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.gz
brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.bz2
- Patch #149176 by chx, David et al: getting rid of the sequences table, using db_last_insert_id() instead of db_next_id().
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/file.inc b/includes/file.inc
index 9bf86930b..32f331b5a 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -574,8 +574,8 @@ function file_save_upload($source, $validators = array(), $dest = FALSE, $replac
}
// If we made it this far it's safe to record this file in the database.
- $file->fid = db_next_id('{files}_fid');
- db_query("INSERT INTO {files} (fid, uid, filename, filepath, filemime, filesize, status, timestamp) VALUES (%d, %d, '%s', '%s', '%s', %d, %d, %d)", $file->fid, $user->uid, $file->filename, $file->filepath, $file->filemime, $file->filesize, FILE_STATUS_TEMPORARY, time());
+ db_query("INSERT INTO {files} (uid, filename, filepath, filemime, filesize, status, timestamp) VALUES (%d, '%s', '%s', '%s', %d, %d, %d)", $user->uid, $file->filename, $file->filepath, $file->filemime, $file->filesize, FILE_STATUS_TEMPORARY, time());
+ $file->fid = db_last_insert_id('files', 'fid');
// Add file to the cache.
$upload_cache[$source] = $file;