Ver Mensaje Individual
  #23 (permalink)  
Antiguo 29/11/2013, 06:46
Rebellion
 
Fecha de Ingreso: mayo-2007
Mensajes: 48
Antigüedad: 17 años
Puntos: 0
Respuesta: Script Insert

Vale, acabo de hacer lo siguiente he modificado el script de esta forma poniendo como dices los campos te lo pego aqui:

Código PHP:
<?php

$tabla 
"wordpress"
$servidor "localhost"
$usuario "root"
$clave ""
set_time_limit(0); 
mysql_select_db($tabla,mysql_connect($servidor,$usuario,$clave)) or die("Error de conexión con la base de datos."); 
$consulta mysql_query("Select sid, title, time, hometext, bodytext from nuke_stories"); 
while(
$fila=mysql_fetch_array($consulta)){ 
$sid "'" $fila['sid'] . "'"
$title "'" $fila['title'] . "'"
$time "'" $fila['time'] . "'"
$hometext "'" $fila['hometext'] . "'"
$body "'" $fila['bodytext'] . "'"

echo
"$body"
echo 
"<p>ID $sid fecha: $time noticia: $title</p>"
 
$sqlinsert="INSERT INTO wp_posts 
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count)
VALUES ($sid, '1', $time, $time, $hometext, $title,'', 'publish', 'open', 'open', '','','','', $time, $time,'', '0','', '0', 'post','', '0')"
;  
mysql_query ($sqlinsert
OR die(
mysql_error() ); 
}
?>
Bueno pues al final el error que me acaba mostrando es el siguiente;

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'puesto en la accidentada carrera de Mieres le ha dado fuerza , habra que observa' at line 3

El mismo creo;