1) Following is the original data:
449346|DILIP PANDYA
444346|MANORANJAN PAL
123456|Ajin Kya
Following is the command used to upload the data:
load data local infile '/temp/emp.txt' into table dinesh fields terminated by'|';
The output of load command is:
Query Ok, 3 rows affected(0.00 sec)
Records: 3 Deleted: 0 Skipped: 0 Warnings: 0
2) Now when I query the database using command line client by
MySQL> select * from dinesh;
I get the output:
+-------------+------------------------+
| srno | name |
+-------------+------------------------+
| | Ajin Kya
| 44346 | MANORANJAN PAL
| 346 | DILIP PANDYA
+-------------+-------------------------+
3 rows in set (0.00 sec)
3) From PHP the data looks ok.
This is the PHP Code:
<html>
<body>
<?php
$con = mysql_connect('localhost','dinesh','dinesh');
if (!$con)
{
die('Could not Connect'. mysql_error());
}
mysql_select_db("dinesh",$con);
$result = mysql_query("SELECT * FROM dinesh");
while($row = mysql_fetch_array($result))
{
echo $row['srno'] . " " . $row['name'];
echo "<br />";
}
mysql_close($con);
?>
</body>
</html>
and this is the output:
123456 Ajin Kya
444346 MANORANJAN PAL
449346 DILIP PANDYA
4) Problem occurs in command line client.