Ver Mensaje Individual
  #15 (permalink)  
Antiguo 13/06/2011, 15:36
maxvt
 
Fecha de Ingreso: febrero-2011
Ubicación: Guatemala
Mensajes: 21
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: Cambiar nombre de archivos en PHP y MYSQL

Cita:
Iniciado por abimaelrc Ver Mensaje
Fue un error mio, no me acordé del segundo parametro, debería ser algo así
Código PHP:
Ver original
  1. <?php
  2. $file = 'foo.jpg';
  3. $pathInfo = pathinfo($file);
  4. rename($file, 'nombre_nuevo' . $pathInfo['extension']);
<?
include("config.php");
$dcans = mysql_query("select * from canciones order by rand() LIMIT 25");
$totales = mysql_num_rows($dcans);
$n=0; while($dat_can = mysql_fetch_array($dcans)) { $n++; if($n == $total) { $title .= "".$dat_can[titulo].""; } else { $title .= "".$dat_can[titulo]."<br>"; }}
$file = '/';
$pathInfo = pathinfo($file);
rename($file, '<? echo $title ?>' . $pathInfo['extension']);
?>

me da el mismo error :( :( :(

Creo que no se puede cambiar el nombre masivamente a los archivos