We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    hi im haviang a problem whith this instruction
    any one cold tell me the error
    $sql = "INSERT INTO ".$modx->getFullTableName(’site_content’)." (pagetitle,alias,template,published,delete,hidemenu,parent,content) VALUES (’".$pagetitle."’,’".$alias."’,’$template’,’$published’,’$delete’,’$hidemenu’,’$parent’,’".$content."’)";
    $rs = $modx->db->query($sql);
    and the error
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - 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 ’delete,hidemenu,parent,content) VALUES (’ddddd’,’ddddd’,’4’,’0’,’0’,’0’,’1’,’ddd’ at line 1 »
    SQL: INSERT INTO `puedesbe_proyectoshydra`.modx_site_content (pagetitle,alias,template,published,delete,hidemenu,parent,content) VALUES (’ddddd’,’ddddd’,’4’,’0’,’0’,’0’,’1’,’ddddd’)
    thanks
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 26016
      • 561 Posts
      Javier,
      Amigo, por Dios, este query es complicado! grin Me pregunto si se puede funcionar este:

      [this query is complicated, I wonder if this might work]

      $sql = "INSERT INTO ".$modx->getFullTableName('site_content')." (pagetitle,alias,template,published,delete,hidemenu,parent,content) VALUES ('".$pagetitle."','".$alias."','".$template."','".$published."','".$delete."','".$hidemenu."','".$parent."','".$content."')";
      $rs = $modx->db->query($sql);


      No estoy seguro, pero vamos a ver. Lo siento por mi espanol.

      Saludos, Samba
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 32982
        • 674 Posts
        hola samba muchas gracias por tu ayuda, pero sigue sin funcionar, no entiendo muy bien porque ya que lo que me propones ya lo habia probado antes. realmente no consigo ver cual es el error en esta "complicada" sentencia pero es para un modulo que estoy terminando muy interesante....que crea documentos en modx a lo bestia,(30 a la vez)
        thanks but still dont work...
          Jabiertxof (formerly XYZVISUAL)
          My bussines: http://marker.es
          https://www.youtube.com/user/jabiertxof/videos
          • 32982
          • 674 Posts
          the table is deleted not delete
          la tabla es delete not deleted
          gracias de nuevo samba
            Jabiertxof (formerly XYZVISUAL)
            My bussines: http://marker.es
            https://www.youtube.com/user/jabiertxof/videos