title: How to write a query to fetch 'Hello World' as 'Hello-World'
body: <p>I'm a bit stuck here. I'm actually rewriting URL, All url who have single word seems to work fine but double word name is not working.</p>
  
  <p>Here is my rewrite code</p>
  
  <pre>
  RewriteEngine on
  RewriteRule ^cheap-flights-to-([A-Za-z0-9-]+)/?$ flight_details.php?dest=$1 [NC,L]
  </pre>
  
  <p>My MySQL Database have a table column <em>dest_name</em> with the values like for example "New York, Hong Kong, Kuala Lumpur etc."</p>
  
  <p>Here is my Query</p>
  
  <pre>
      $flights_query = mysql_query("SELECT * FROM `fares` WHERE `dest_name`='$to_dest' AND `dept_code`='$from_airport' AND `ticket_class`='Y/Y' AND `fare_type`='$flight_type' ORDER BY fare+tax limit 15");
  
      while($flights_fetch = mysql_fetch_array($flights_query)) {
          $fares = $flights_fetch['fare'] + $flights_fetch['tax'];
          $addpercent = ($fares * $percent) / 100;
          $final_fares = number_format($fares + $addpercent,2);
      }
  </pre>
  
  <p>When I output I add hyphen using PHP function... But it's not fetching data...</p>