Ok. I have ZERO PHP Knowledge, still good in editing php and all that stuff. Only know copy paste and have no knowledge what that means. Still would try to explain my problem.
I use variable to fetch data from mysql. Ex. my url is http://www.example.com/venue.php?vcity=New York.
Now, I want to replace New York with New-York. The real url I am trying to get is http://www.example.com/venue-new-york.php.
For that I added code in htaccess
RewriteRule ^venue-([^/]*)\.php$ /venue.php?vcity=$1 [L]
I Know what I added in htaccess is mostly perfect.
Now, I am using smarty so would be able to do lower case and replace space with dash. But that would not allow me to fetch data from mysql for some reason. In class file I have following code.
function getallvenueschedule()
{
global $db,$smarty;
$sql = " SELECT * FROM table WHERE vcity = '$this->vcity' AND sch_date >= '$this->sch_date' ORDER BY timestmp ASC";
$theList = $db->getAll($sql);
return $theList;
}
In the venue.php file below is code.
$vcity = $_GET['vcity'];