I have this script to make a CSV file to output from mysql, I got the code off the site here, but have little experience with this.
$cols=array('54436476'=>'Dealer ID',
'STOCK'=>'Stock Number',
'YEAR'=>'Year',
'MAKE'=>'Make',
'MODEL'=>'Model',
'TRIM'=>'Trim',
'VIN'=>'VIN',
'MILEAGE'=>'Mileage',
'PRICE'=>'Price',
'EXTERIORCOLOR'=>'Exterior Color',
'INTERIORCOLOR'=>'Interior Color',
'TRANSMISSION'=>'Transmission',
'IMAGE_LOCATION'=>'Image_name',
'OPTIONS'=>'Description');
mysql_connect("", "", "");
mysql_select_db("");
$SQL="SELECT * FROM inventory WHERE TYPE = 'U' AND ACTIVE = '1'";
$csv="";
$sizeof_cols=sizeof($cols);
$RS=mysql_query($SQL);
//output column headers
foreach($cols as $key=>$value) {
$csv.='"'.$value.'",';
}
$csv.="\r\n"; // line break
// output column data
while($myrow=mysql_fetch_assoc($RS)){
foreach($cols as $key=>$value) {
$csv.='"'.$myrow[$key].'",';
}
$csv.="\r\n"; // line break
}
if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5.5")) {
$att = "";
} else {
$att = " attachment;";
}
header('Content-Type: application/download; name="export_new.txt"');
header('Content-Disposition:'.$att.' filename="export_new.txt"');
header('Content-Transfer-Encoding: binary');
echo $csv;
I want the dealer id to be a set value, and to add the url to the image location. And I would also like to FTP this file.
Thanks for any help.