Jump to content

Nikandlv

New Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Nikandlv

  1. This discussion is silly. Every nontrivial web application makes dozens or hundreds of queries per request, and modern database systems can easily handle this. That's what they're made for. Even complex queries involving millions of rows (not just some title lookup) are no problem at all as long as you use proper indexes. Query results are also cached, so the query isn't actually executed “for every visitor”.

     

    Stop trying to solve problems that aren't there.

    then sorry for asking ! i was wondering how it works .

    im not that level experienced to know that 

  2. Well, I suppose it is more efficient to hardcode the title, but it is less flexible and realistically, it the performance doesn't matter.

     

    But instead, why not get all your site information with one query, and then just echo("<h1>$siteStuff[title]</h1>");?

    i guess so ,  that will be a good idea to get the info as an array for all of stuff i want in my page i t will do the request once 

    thanks for the suggestion 

  3. Hi , 

    Im wondering if is it efficient to do a sql (using pdo) quary for every visitor of website ?

    for example 

    we have a page 

    and we have a  <h1> tag  and its how we use it in here 

    <?php

    echo '<h1>';

    echo getthewebsitetitlefromdbfunctionlol() ;

    echo '</h1>;

    ?>

    and the getthewebsitetitlefromdbfunctionlol() will basically selects the title from db and return it .

    so is it efficient to do this for every visitor of the page ? 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.