Running into an issue trying to rename a file name by appending the name with the Current date while moving it to another location
I'm close, but not quite there....
Here is my code...
Code: Select all
$sql1='SELECT CURDATE();';
$result1 = mysqli_query($link, $sql1);
$row1[] = mysqli_fetch_array($result1);
$date = implode(',', $row1);
$destfile='C:/wamp/www/Test/Upload/Files/csv/' . basename($_FILES['upload']['name'] . $date);
$ret = move_uploaded_file($_FILES['upload']['tmp_name'], $destfile);It actually makes two files in the appropriate folder
Book1.csv2010-01-13,2010-01-13
and
Book1.csvArray
and I get two messages when the code runs:
Notice: Array to string conversion in C:\wamp\www\Test\Upload\index.php on line 55
Warning: mysqli_query() [function.mysqli-query]: (00000/0): in C:\wamp\www\Test\Upload\index.php on line 72
query failed:
what am I doing wrong?
BTW... I know there is a problem with where the appended data is showing up, but I am not worried about that currently... I am only looking to get it to create one file with the date on the end of the file name once
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: