View Single Post
  #6  
Old 27th January 2006, 07:35
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Quote:
Originally Posted by Accura
__________________________________________________ _________
include_once("../../connection.php");
while ($data = fgetcsv($handle, 4096, $separator))
{
if (count($data) >= 15 && $data[0] != "" && $data[1] != "" && $data[2] != "" && in_array($data[3], array("B", "L")) && in_array($data[4], array("R", "C")) && is_numeric($data[5]) && $data[5] >= 0 && is_numeric($data[6]) && $data[6] >= 0 && in_array($data[7], array("T", "F")) && is_numeric($data[9]) && $data[9] >= 0 && in_array($data[10], array("P", "S", "T", "C")) && format_date($data[12]) && format_date($data[13]))
{
mysql_query("insert into properties(property_id, property_description, property_location, property_rooms, property_bathrooms, property_other_details, property_price, property_date_posted, property_last_date_available, agent_id, property_postcode, property_letorbuy, property_contract, property_accepted, property_contract_terms, property_of_week, property_available_from, property_furniture, property_type) values('', '" . str_replace("'", "`", $data[0]) . "', '" . str_replace("'", "`", $data[1]) . "', {$data[5]}, {$data[6]}, '" . str_replace("'", "`", $data[8]) . "', {$data[9]}, now(), str_to_date('" . format_date($data[13]) . "', '%Y-%m-%d %T'), {$_SESSION['user_id']}, '" . str_replace("'", "`", $data[2]) . "', '{$data[3]}', '{$data[10]}', 'T', '" . str_replace("'", "`", $data[11]) . "', 'F', str_to_date('" . format_date($data[12]) . "', '%Y-%m-%d %T'), '{$data[7]}', '{$data[4]}')");
$result = mysql_query("select property_id from properties order by property_id desc limit 1");
$property_id = 0;
if ($array = mysql_fetch_assoc($result))
{
$property_id = $array["property_id"];
}
mysql_free_result($result);
for ($i = 14; $i < count($data); $i++)
{
for ($j = 0; $j < $_POST["image_files_no"]; $j++)
{
if ($data[$i] != "" && str_replace("'", "`", $data[$i]) == str_replace("'", "`", $_FILES["image_files"]["name"][$j]))
{
$result = mysql_query("select image_id from property_images where image_name = '" . str_replace("'", "`", $data[$i]) . "'");
if (mysql_fetch_assoc($result))
{
mysql_free_result($result);
continue 2;
______________________________________________
It seems as if the highlighted code has to do with your problem. Have you read that software's documentation? I think the authors intended it to be like that...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote