Announcement

Collapse
No announcement yet.

Webinar DB_CONVERT

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webinar DB_CONVERT

    Hello,

    On the following link you can download the video from the webinar today about XLS, CSV and Access Importation with txt file reading:

    http://youtu.be/EVlUZR-6zcM

    During the example we used two blanks to make the .txt file reading and import the files manually:

    Blank 1:

    ?>
    <center>
    <form style='margin-top:50px;' action="../blank_2/blank_2.php" method="POST" enctype="multipart/form-data">
    <fieldset>
    <p><label for="Enviar arquivo">Send File:</label></p>
    <input type="file" name="arquivo" class="width233" />
    <input type="submit" name="enviar" value="Enviar" />
    </fieldset>
    </form>
    </center>
    <?php



    Blank 2:

    $arquivo = $_FILES['arquivo'];
    $file = file($arquivo['tmp_name']);
    $file_name = explode(".",$arquivo['name']);

    foreach ($file as $line_num => $line) {
    if($line_num==0){
    $colunas = str_replace(" "," varchar(255),",$line);
    sc_exec_sql("CREATE TABLE IF NOT EXISTS ".$file_name[0]." (".$colunas." varchar(225) )","conn_mysql");
    $colunas = str_replace(" ",",",$line);
    }
    if($line_num>=1){
    $dados = str_replace(" ","','",$line);
    sc_exec_sql("INSERT INTO ".$file_name[0]." ( ".$colunas.") values ( '".$dados."')","conn_mysql");
    }
    }
    sc_lookup(ds,"SELECT COUNT(*) FROM ".$file_name[0],"conn_mysql");
    if({ds[0][0]}>0){
    sc_alert("success!");
    }
    Last edited by sales.scriptcase; 11-21-2014, 05:13 PM.

  • #2
    Marcia, why not put the webinars on youtube and your website like the rest?
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hello Alberto

      We will do that, we are currently working on the videos area to renew the and remove the old videos and then continue adding the videos on the webinar page. That is why am adding here for while.
      Thanks!

      Comment


      • #4
        An interesting example, but I do not know how to modify it for my needs.
        Maybe anyone can help.

        The association of people with diabetes have a case excel file with the members, which should be imported into Mysql database to see some statistics.
        Always importing the same file and still has the same name. Imported, however, say 1x per month if there are changes.
        Import should xls or possibly cvs file. And that they should do so in a simple manner, as shown in this case.

        But this example imports all records and does not verify the existing records. So, if the first imported 500 members and then to the same file again in the database 1,000 members. So double entry.
        I searched the entire forum as a case of imports simply can not find it. Of course, I'm not a programmer, so here I ask for help if someone can help.
        Thank you

        PS: if here is not the place for a discussion about this please moderator to move the topic to the appropriate location.

        Comment

        Working...
        X