Note that there are some explanatory texts on larger screens.

plurals
  1. POMysql load data infile wrong path
    primarykey
    data
    text
    <p>Hi I badly need you help.</p> <p>Error showing after importing .CSV file using mysql load data infile.</p> <p>I have a form upload below which working fine</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; </code></pre> <p>and a PHP upload script using load data infile.</p> <pre><code>require("../config/conn.php"); if (is_uploaded_file($_FILES['my-file']['tmp_name']) &amp;&amp; $_FILES['my-file']['error']==0) { $path = 'C:/xampp/htdocs/dom/test/uploads/' . $_FILES['my-file']['name']; if (!file_exists($path)) { if (move_uploaded_file($_FILES['my-file']['tmp_name'], $path)) { echo $mysql = "LOAD DATA LOCAL INFILE '".$_FILES['my-file']['name']."' REPLACE INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n' IGNORE 1 LINES (`col1`,`col2`,`col3`,`col4`,`col5`....)"; $query = mysqli_query($link, $mysql) or die(mysqli_error($link)); if(!$query) { printf("Error message: %s\n", mysqli_error($link)); } } else { echo "The file was not uploaded successfully."; } } else { echo "File already exists. Please upload another file."; } } else { echo "The file was not uploaded successfully."; echo "(Error Code:" . $_FILES['my-file']['error'] . ")"; } </code></pre> <p>Everything is fine, except the load data local infile cannot see the right path. please see the error: <strong>Can't find file 'logJan262013.CSV'.</strong> but the .csv file is uploaded successfully in folder 'uploads/'. Any help would be appreciated.</p> <p>thanks alot!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload