Ver Mensaje Individual
  #15 (permalink)  
Antiguo 28/11/2013, 12:17
martin_9_91
 
Fecha de Ingreso: mayo-2011
Ubicación: Bs.As Argentina
Mensajes: 193
Antigüedad: 13 años
Puntos: 3
Respuesta: Script Insert

A ver....

Cambialo así:

Código PHP:
Ver original
  1. $tabla = "wordpress";
  2. $servidor = "localhost";
  3. $usuario = "root";
  4. $clave = "";
  5. mysql_select_db($tabla,mysql_connect($servidor,$usuario,$clave)) or die("Error de conexión con la base de datos.");
  6. $consulta = mysql_query("Select sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, ihome from nuke_stories limit 6");
  7. while($fila=mysql_fetch_array($consulta)){
  8. $sid = "'" . $fila['sid'] . "'";
  9. $title = "'" . $fila['title'] . "'";
  10. $time = "'" . $fila['time'] . "'";
  11. $hometext = "'" . $fila['hometext'] . "'";
  12. $body = "'" . $fila['bodytext'] . "'";
  13.  
  14.  
  15. $title = $fila['title'];
  16. echo"$body";
  17. echo "<p>ID $sid fecha: $time noticia: $title</p>";
  18.  
  19. $sqlinsert="INSERT INTO wp_posts VALUES ($sid, '1', $time, $time, $hometext, $title,'', 'publish', 'open', 'open', '','','','', $time, $time,'', '0 ','', '0', 'post','', '0 '); ";  
  20. mysql_query ($sqlinsert)
  21. OR die("Fatal error" );
  22. }