Is this normal? am i right?

Discussion in 'PHP' started by slaydragon, Jul 25, 2008.

  1. #1
    hi,

    i am developing a video script like youtube. I have around 5 to 7 mysql queries in a php file called index.php.. is this normal? is it normal to have alot of sql queries in one php file? i am doing so because i need to get different data from many different tables.. am i doing the correct way? appreciate any advices. green given.
     
    slaydragon, Jul 25, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    How could we possibly know without seeing your code?

    Generally, it's always the best to limit your amount of queries as much as possible. Often you can select data from multiple tables with one single query. That however depends on each case. (We don't know if this case applies to you without knowing more details.)

    It also depends on what your queries actually do, and how big your tables are, how your tables are structured/designed... There can be a LOT of difference.
     
    nico_swd, Jul 25, 2008 IP
    slaydragon likes this.
  3. kind_of_the_cash

    kind_of_the_cash Active Member

    Messages:
    852
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    85
    #3
    Yah It's normal but don't use more query's use external files to call them
     
    kind_of_the_cash, Jul 25, 2008 IP
    slaydragon likes this.
  4. slaydragon

    slaydragon Banned

    Messages:
    1,403
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    external file, do you mean includes and requires?
     
    slaydragon, Jul 25, 2008 IP