|
Posted by frizzle on 11/17/67 11:34
Henrik Hansen wrote:
> "frizzle" <phpfrizzle@gmail.com> writes:
>
> > Hi Group,
> >
> > I'm builiding a sort of a news-site, with a mySQL backend.
> > Nowadays, i come across a lot of news-pages with the
> > title of the article in the URL. For example this one:
> > http://www.nieuwnieuws.nl/ (dutch in this case)
> >
> > Anyway, every article seems to have it's own html-page.
> > I know that the page in my example actually has php-pages and
> > a mysql-db.
> >
> > In my own site, i use htaccess to simulate directories and everything,
> > but what i wonder is how THIS system works.
> > If site.com/news/hot_news.html is converted to
> > site.com/news.php?article=hot_news,
> > Does this mean that the PHP looks in the DB "WHERE article =
> > 'hot_news'" ?
> > Meaning it looks for a piece of text instead of an actual id?
> >
> > Wouldn't it mean the queries would be extremely slow?
> >
>
> could also be something like:
>
> switch ($_GET["article"]) {
> case "hot_news":
> //do stuff
> break;
> }
>
> if you see my point. I agree using text for the id is not the best
> thing to to, but they could also be doing somekind of join with a
> artucle type table like:
>
> select *
> from articles, article_types
> where article_types.type_name = 'hot_news'
> and articles.type = article_types.type
>
> --
> Henrik Hansen
Thank you both for your answer!
Maybe 'hot_news' wasn't that good of a choice.
I meant that as a name of an article, not as a type
of news. So i guess the second explanation with swicth/case
isn't appropriate here? Or am i missing out on something?
And what it comes to the mod_rewrite part, AFAIK this works
with set up grids to which an URL should comply.
Like site.com/news/78346_cool_article_over_here.html
becomes site.com/news.php?id=78346
(if you get what i mean)
I still can't imagine there is a full-text search query related to
this.
(Even if the url would be saved in an extra field, and use
SELECT WHERE url = $_GET['url'] )
Thanks.
Navigation:
[Reply to this message]
|