Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    sql
    sql is offline
    Junior Member
    Join Date
    Oct 2003
    Location
    hell
    Posts
    8
    Member #
    3702
    i have a text file with some line of text ..

    i use this code to randomly pick a line in the text file and show it on the webpage...

    PHP Code:
    $random_file 'blah.txt';
    $random file($random_file);

    srand();
    $randomizer rand(0count($random) );
    $znumber rand(12);

    if( !isset(
    $random[$randomizer]) )
    {
       
    $random[$randomizer] = '';

    right now the file is just a few line .. what if it becomes 5000 lines ..will it gonna slow down the process ?? will the database query will be better???

    thank,
    sql

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    if you get to 5000 records, you should seriously consider using a database.... it will always be faster, because database servers are designed to index, cache, and query the information within them.

  4. #3
    Junior Member
    Join Date
    Dec 2002
    Location
    chennai , tamil nadu , India
    Posts
    13
    Member #
    384
    benchmark

    it is best to use benchmark in your php scripts to actually know for sure when the mysql database becomes necessary

    do something like http://php.weblogs.com/benchmark.php
    Chris, Developer, Chrisranjana.com
    Software developers,
    Php and RoR programmers,
    http://www.chrisranjana.com

  5. #4
    sql
    sql is offline
    Junior Member
    Join Date
    Oct 2003
    Location
    hell
    Posts
    8
    Member #
    3702
    heeh .. okey .. thank.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:32 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com