Thursday, 15 March 2012

Upload xml files in a folder to Mysql using Php using glob and array -


I have many XML files in a folder on my webserver

  • in the folder < Li> Get the XML file name
  • Enter the filenames in the array
  • Loop those names
     $ files = glob ('* .xml ') contains the contents of all XML files included  
  • files in the form of foreign currency ($ file $) {mysql_query ("load data INFILE". $ File. '' '' In the table);}

    In I have spent a few days looking for an example or tutorial but nothing can be found online.

    Above all I can come to the top.

    Any help appreciated :)

    There is nothing wrong with your code but to do so; < P> 1 - The XML files must be located in the MySQL Data folder. Otherwise, you can not use the load data.

    2 - PHP Script requires that the root The user may have to start with the MySQL server. Otherwise, scripts will not be able to access and process files.

    If you are trying to do this on shared hosting, then I can say that you can not do this due to many restrictions.

  • No comments:

    Post a Comment