Welcome Guest, Not a member yet? Register   Sign In
url_title()
#1

[eluser]E303[/eluser]
Been playing around with this a bit lately but what I can't work out is if, you set the post title for instance
Code:
$postTitle = url_title($postTitle);

how do you go about searching for that in a mysql. The mysql results wouldn't have the "-" for spaces so you don't get any results?
#2

[eluser]ejangi[/eluser]
I'm not sure I understand 100% what you're doing, but I'm guessing that you want clean URL's right?

So, you would have an article URL like:
Code:
http://mydomain.com/articles/my-search-friendly-url

If that the case, in your Articles table, you should have the fields:
- id (e.g. 234)
- title (e.g. "My search friendly URL")
- body (i.e. The article itself)
- permalink (e.g. "my-search-friendly-url")

That way when you do a search, you're simply querying the title and when browsing to the page, you just lookup the permalink. Make sense?
#3

[eluser]E303[/eluser]
Exactly what I was looking for thank *ucantblamem*




Theme © iAndrew 2016 - Forum software by © MyBB