I am new to MySQL, completing the piece of code inherent in my webapp. The code imports the CSV file (locally), which is created and cleared by FileMaker and leaves it.
With this in mind, it will be launched soon (and perhaps there will be a database under 500 MB), I would really like to know if there is any better check / catch of errors that I could make to prevent problems in the future or to be warned about setting up my server. I read information about temp logs, etc., And my MySQL administration is not yet able to sniff.
The simplest code:
$m = mysql_connect('localhost', 'mytable', 'mypassword'); $db = 'mydb'; mysql_select_db($db) or die("Import Error - Couldn't select database: " . mysql_error()); $sql = 'load data local infile "inventory.csv" into table ibl_account_details_temp fields terminated by "," optionally enclosed by "\"" lines terminated by "\r" (store_id, SKU, account, item_number, brand, description, size, category, price, qty, fees) '; echo mysql_query($sql) or die(myqsl_error());
PS EDIT: I would also be interested to know if this import method is open for SQL injection?
source share