SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict ibeblunt's Avatar
    Join Date
    Jan 2001
    Location
    Jersey City, NJ
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The other day, I was reading some book called Essential PHP and found two functions that I've seen before but never used.

    mysql_free_result($result_string);

    mysql_close($dbconnection_string);

    The book was saying that I could save resources by using these two functions. And in most of the examples, it showed them in use.

    Should I start using these functions? and how come programs like vBulletin v. 1.1.5 doesn't use any of these functions?
    <///////~

    www.sohh.com

  2. #2
    SitePoint Evangelist
    Join Date
    May 2000
    Location
    Canada
    Posts
    533
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm assuming vB uses mysql_pconnect , in which case a connection shouldnt be closed

    as for using those functions, if your script is long and runs for a long time, mysql_free_result is a must, generally for normal websites, this doesnt make much of a difference (unless you are gathering HUGE amounts of data, and then doing it a few times)

    as for mysql_close.. again, its not a necessity .. if you used mysql_connect to start with, the connection is closed at the end of the script automatically..

    remember, PHP doesnt teach you how to code, it does everything for you .. its like the netscape / IE thing.. netscape might be a pain to design for, but thats only because netscape follows set specifications by w3.org instead of IE which goes on making its own specifications, allowing for poor design
    cogito, ergo sum

  3. #3
    SitePoint Addict ibeblunt's Avatar
    Join Date
    Jan 2001
    Location
    Jersey City, NJ
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, I did a search for "mysql_pconnect" and came up with 0 results. Weird. But I know the the opening page on VB has like 13 queries or more depending on what options you have turned on.
    <///////~

    www.sohh.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •