upload text file into MySQL database

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default upload text file into MySQL database

    Hi, I am really new with PHP and MySQL. My problem is when I run the
    following script in the PHP program, nothing is uploaded even though I have
    45K records in the filename.txt.

    load data file 'filename.txt' into table tablename fields terminated by ','
    enclosed by '"' lines terminated by '\n';

    When I use the Mysql prompts, it works, when I transfer the script to PHP
    program, it does not work. Anything wrong with the script? Or am I missing
    some PHP command?

    Thanks very much

    Mr. Lee Kim Hock



    Lee Kim Hock Guest

  2. Similar Questions and Discussions

    1. I need PHP and MySQl base file or image upload Extension
      I am using php and MySQL in my web site my site is www.cyberbogra.com Now i am suffering for php and MySQL base image or file upload extion. Please...
    2. Upload an Image to the mysql database
      Hi! I need help on how to upload an image to mysql database directly. I needed the images to be saved directly to the mysql database. Is there a...
    3. Upload File to Access Database
      I have a Dreamweaver Page which is attached to a MS Access Database in Cold Fusion. In the page is a browse button which opens the select file...
    4. upload a jpg file to an access database...???
      I think I heard that you can't have a jpg in an access database, however you could point to where the jpg was from within the database. What I need...
    5. upload a file to a database in my sql
      I have a B.D made in access and of which also I have respective tables of the B.D. in xls. However what I want is: To come back to make the...
  3. #2

    Default Re: upload text file into MySQL database

    Lee Kim Hock wrote:
    > Hi, I am really new with PHP and MySQL. My problem is when I run the
    > following script in the PHP program, nothing is uploaded even though I
    > have 45K records in the filename.txt.
    >
    > load data file 'filename.txt' into table tablename fields terminated by
    > ',' enclosed by '"' lines terminated by '\n';
    >
    > When I use the Mysql prompts, it works, when I transfer the script to PHP
    > program, it does not work. Anything wrong with the script? Or am I missing
    > some PHP command?
    >
    Using same database server/authentication details?

    Got a connection to the database you can run a 'SELECT....' from?

    escaping quotes?

    HTH

    C.
    Colin McKinnon Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139