4

The following code correctly uploads .csv file in MySQL in WAMP Server, but it is not working on GoDaddy shared hosting:

<?php


$con = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);

if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
};
$sql = "LOAD DATA INFILE 'Dis.csv'
       INTO TABLE  `single-ecolo-dis-no-tbl` 
       FIELDS TERMINATED BY ','
       OPTIONALLY ENCLOSED BY '\"' 
       LINES TERMINATED BY '\n' 
       IGNORE 1 LINES;";

I am not getting any error message, just a white page. I am sure all the credentials are correct. There is not any connection issue. It looks like the query is not running at all.

Edit: After enabling error display I am getting this error message after loading the page:

The user update failed: Access denied for user 'theUser'@'localhost' (using password: YES)

08Dc91wk
  • 4,254
  • 8
  • 34
  • 67
Suffii
  • 5,694
  • 15
  • 55
  • 92
  • white screen of death: error checking\display are off, turn them on to see the error. at the top of your php page add: `ini_set('display_errors', 'On'); ini_set('html_errors', 0); error_reporting(-1);` –  Jul 28 '15 at 03:48
  • Thanks Dagon, after adding the codes now I am getting this: `The user update failed: Access denied for user 'theUser'@'localhost' (using password: YES)` – Suffii Jul 28 '15 at 08:07
  • Db credentials are wrong –  Jul 28 '15 at 09:15

1 Answers1

0

Your username and/or password are incorrect for your MySQL database. Make sure you have the correct credentials and then try again.

You could always ask GoDaddy for support if you are unsure on where to get the correct login credentials from.

rosey85uk
  • 95
  • 2
  • 12