KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have an INSERT statement in a PHP-file wherein at-signs (@) are occurring in front of the column name. @field1, @field2, It is a MySQL database. What does the at-sign mean? Edit: There is no SET @field1 := 'test' in the PHP script. The PHP script reads a csv and puts the data into the table. Can it be misused as a commenting out feature? <?php $typo_db_username = 'xyz'; // Modified or inserted by TYPO3 Install Tool. $typo_db_password = 'xyz'; // Modified or inserted by TYPO3 Install Tool. // login $_SESSION['host'] = "localhost"; $_SESSION['port'] = "3306"; $_SESSION['user'] = $typo_db_username; $_SESSION['password'] = $typo_db_password; $_SESSION['dbname'] = "database"; $cxn = mysqli_connect($_SESSION['host'], $_SESSION['user'], $_SESSION['password'], $_SESSION['dbname'], $_SESSION['port']) or die ("SQL Error:" . mysqli_connect_error() ); mysqli_query($cxn, "SET NAMES utf8"); $sqltrunc = "TRUNCATE TABLE tablename"; $resulttrunc = mysqli_query($cxn,$sqltrunc) or die ("Couldn’t execute query: ".mysqli_error($cxn)); $sql1 = " LOAD DATA LOCAL INFILE 'import.csv' REPLACE INTO TABLE tablename FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\"' IGNORE 1 LINES ( `normalField`, @field1, @field2, `normalField2`, @field3, @field4 )"; $result1 = mysqli_query($cxn,$sql1) or die ("Couldn’t execute query: " . mysqli_error($cxn)); ?>' SOLUTION : Finally, I found it out! The @ field is used as dummy to miss out a column in a csv-file. See http://www.php-resource.de/forum/showthread/t-97082.html http://dev.mysql.com/doc/refman/5.0/en/load-data.html
Tags (comma-separated)
Save Edits
Cancel