Loading CSV into MySQL table with PHP

后端 未结 1 1332
时光说笑
时光说笑 2020-12-02 02:57

I am trying to import a CSV into a MySQL table with a PHP script. This SQL command successfully imports the CSV file into the SQL table:

mysql> LOAD DATA         


        
相关标签:
1条回答
  • 2020-12-02 03:08

    The cause of the error is the request you've send to the webserver. The webserver tries to fulfill the request and executes scripts to do that, in your case, the PHP script.

    The PHP script now fails. The webserver only knows it failed, but as the webserver does not know anything specific, it will only give back the so called Internal Server Error (the error happened internally), code 500. The exact error information is hidden because the error was not expected and no internal information should be leaked to the outside world.

    From the message alone, nobody can say what happened. You need to look into the error log of your webserver and check what the internal reporting was.

    In your case I would assume that your PHP script has a fatal error. You can also enable PHP error display and logging, see PHP Does Not Display Error Messages.

    When you do that, you might see more error messages. Common happening error messages are explained in our error reference: Reference - What does this error mean in PHP?.

    If I should place a guess, I'd say you're seeing this because your PHP file does not parse. Most likely the following error:

    • Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE

    Happy trouble-shooting!

    0 讨论(0)
提交回复
热议问题