How to insert data into mysql from *.enw file

mysql , php Erie, United States
  • 14 years ago
    Hello,
    I'm a php newbie. I wanna ask how put in data from *.enw file into mysql database, but the data that i'm trying to put in is based on the part that's in the *.enw file (ei: %A means to put in data into the same author table.) No author's name can be the same.  After that I have to put it into html page and the last data that's put in has to be on the top of the list.

    Best Regrads






  • 14 years ago
    A couple of questions to clarify what you are trying to do so that you'll get a better answer:

    1.  .enw = Sierra LandDesigner 3D Terrain Modeling format, right?  Is this file in plain text or does it have a lot of markup that you need to parse and/or remove?

    2.  Are you trying to write a php script to put the file contents into the mysql database or can you use a mysql frontend directly (i.e. can you access mysql from the commandline)?  Also, is this a use once thing or are you trying to set up an automatic way to process many files?  Are you trying to setup a webpage where someone can upload a .enw file and you load it into a database and give them back the results or is it just for you?

    If you need to display the last database entry as the first line of the output, then the array_reverse() function might help you - here's the description from the PHP 5.1 manual (check out the Array functions in chapter VI of the online manual - http://www.php.net/manual/en/):

        array array_reverse ( array array [, bool preserve_keys] )

        array_reverse() takes input array and returns a new array with the order of the elements reversed,    preserving the keys if preserve_keys is TRUE.

    I hope that this helped, and when you answer these questions maybe someone can give you some useful suggestions.  Good luck!










Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” - Dennis Ritchie