I have written a php script that imports a pipe delimeted file with a ^ as a termination.
The script is pasted below and it works fine apart from when it imports this........
s:\homeview\branch1\images\99\house22.jpg
which is one of the fields in the text file. When I view the table in myphpadmin the \ have gone ??
As a test I changed the slashes to be / in the text file and that worked fine. It seems that my php script does not like \
Any ideas ??????????
<html>
<body bgcolor=silver>
<?php
include ("world_var.php");
$db = mysql_connect("localhost", $world_user,$world_pass);
mysql_select_db($world_data,$db);
$sql = "SELECT * FROM vebraconfig";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$local_propertydata1=$myrow["local_propertydata1"];
include ("world_var.php");
$db=mysql_connect("localhost",$world_user,$world_pass);
mysql_select_db($world_data,$db);
$sql="delete from property";
echo $local_propertydata1;
$result=mysql_query($sql);
$fp=fopen($local_propertydata1,"r");
if (!$fp)
{print "ERROR, file not found";
exit;
}
$sql="LOAD DATA LOCAL INFILE '$local_propertydata1' INTO TABLE property
FIELDS TERMINATED BY '¦' LINES TERMINATED BY '^'";
$result = mysql_query($sql)
or die( mysql_error());
$result = mysql_query("SELECT * FROM property",$db);
$count=mysql_num_rows($result);
echo "<font face=arial size=2 color=black><b>$count"; echo " Records imported</font></b>";
?>
</body>
</html>