title: fputcsv : separate values (fields) with ";" and remove "quote" enclosure
body: <p>Thanks the community I was able to create a script that enable me to export data from a database table into a csv file.</p>
  
  <pre><code>"Article ID",Shoppergroupname,"Promotion Price",VAT-Code,"Article Currency","Promotion Start Date","Promotion End Date"
  10192605,"Aucun Groupe Clients",2.86,2,27,07.01.2010,30.12.2999
  10192689,"Aucun Groupe Clients",3.33,2,27,07.01.2010,30.12.2999
  10193415,"Aucun Groupe Clients",2.40,1,27,07.01.2010,30.12.2999
  10193431,"Aucun Groupe Clients",7.83,1,27,07.01.2010,30.12.2999
  </code></pre>
  
  <p>I would like my data being exported without quotes enclosure and values|fields being separated with <code>;</code> instead of <code>,</code>.</p>
  
  <p>I would appreciate if someone could advise me how to achieve this.</p>
  
  <p>Thanks a lot in advance.</p>
  
  <p>Cheers,</p>
  
  <p>Marc</p>
  
  <p>My script is the following :</p>
  
  <pre><code>// Create connection
  $conn = new mysqli($databasehost, $databaseusername, $databasepassword, $databasename);
  
  // Check connection
  if (mysqli_connect_errno()) {
    exit('Connect failed: '. mysqli_connect_error());
   }
  
   echo "Connected successfully | ";
  
  // Create filename
  date_default_timezone_set('Europe/Zurich');
  $today = date("Y-m-d-G-i-s"); 
  $csvname = "WS_PRICE_IMPORT_".$today.".csv";
  $csvfullname = '/var/.../'.$csvname; 
  
  // Create a file pointer connected to the output stream
  $output = fopen($csvfullname, 'w');
  
  // Output the column headings
  fputcsv($output, array('Article ID', 'Shoppergroupname', 'Promotion Price', 'VAT-Code', 'Article Currency', 'Promotion Start Date', 'Promotion End Date'));
  
  // Fetch the data
  $sql = "SELECT `Article ID`, `Shoppergroupname`, `Promotion Price`, `VAT-Code`, `Article Currency`, `Promotion Start Date`, `Promotion End Date` FROM jos_temppriceimport";
  
  $result = $conn-&gt;query($sql);
  
  if (!$result) {
     echo "Unable to execute query in the database : " . mysql_error();
  exit;
  }
  
  if ($result-&gt;num_rows == 0) {
  echo "No record found, no record to export in CSV.";
  exit;
  }
  
  // Loop over the rows, outputting them
  while ($row = $result-&gt;fetch_row()) fputcsv($output, $row);
  </code></pre>