I'm trying to make some nice urls.
CREATE TABLE IF NOT EXISTS `games` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(200) DEFAULT NULL,
`about` text,
`release_date` int(10) NOT NULL DEFAULT '0'
php
$id = str_replace('_', ' ', $_GET['title']);
$query = mysql_query("SELECT * FROM games WHERE title = '$id'");
$row = mysql_fetch_assoc($query);
if (!mysql_num_rows($query)) exit('This game is not in the database.');
Need some help with replacing characters.
Lets say the title of one of my games is Day of Defeat: Source
i would like to access it with this: Day_of_Defeat_Source
. How would I do that? Removing colons, -, & and all that with nothing. Now its: Day_of_Defeat:_Source
But If I replace : with _ it will look like: Day_of_Defeat__Source
How can I go around this?
Sorry for my cheap english, maybe and moderator can make this more understanable.