Current location: Hot Scripts Forums » Programming Languages » PHP » Very Important Question.


Very Important Question.

Reply
  #1 (permalink)  
Old 08-21-05, 12:16 AM
0o0o0 0o0o0 is offline
Wannabe Coder
 
Join Date: Jul 2005
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Very Important Question.

When do you use ..

mysql_close($conn);

? all the time or just when allowing writing of table entries?
Reply With Quote
  #2 (permalink)  
Old 08-21-05, 05:32 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
when ever you have a 1500 lines script which finish dealing with MySQL in the first 10 lines!
it's up to you to use it or not.. but if you are not using the connection in the rest of the file you can close it yourself or just leave it for PHP to deal with it.
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 08-21-05, 01:49 PM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
oot: 1500 lines of script is hilarious...
__________________
just an ignorant noob with moronic solution...
Reply With Quote
  #4 (permalink)  
Old 08-21-05, 06:44 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by moronovich
oot: 1500 lines of script is hilarious...
Really? What's the "hilarious" part? I've written numerous scripts that long and longer, some of them are over 20,000 lines.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #5 (permalink)  
Old 08-22-05, 02:30 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
it's insufficient! and would cause some heavy resource consumptions.
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #6 (permalink)  
Old 08-22-05, 10:50 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by NeverMind
it's insufficient!
Did you mean "inefficient"? (How could you tell if the code is "insufficient" without seeing it?)


Quote:
Originally Posted by NeverMind
and would cause some heavy resource consumptions.
It seems to run fine and doesn't cause an undue load on the server as far as I'm able to determine.

Are you saying that people just shouldn't write large PHP scripts for any reason? I'm not sure I understand your comment, or the reasoning behind it. Would you please clarify what you mean?
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #7 (permalink)  
Old 08-22-05, 01:48 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
Quote:
Did you mean "inefficient"?
yes, this is what I meant.. sorry about that..

as for the resource consumption, I was wrong when I said heavy! but it does consume more than it should if that file was supposed to be included!
imagine a 1500 lines file which has lots and lots of function definitions.. and you include that file to everypage even the ones that uses 2 or 3 functions out of ,let's say, our 40 functions..
that's what I meant ..
of course if the file will be completly executed, then that's fine
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #8 (permalink)  
Old 10-03-05, 06:52 PM
0o0o0 0o0o0 is offline
Wannabe Coder
 
Join Date: Jul 2005
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
lol thanks for the reply ... i think
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a question on favicon.ico darkcarnival The Lounge 0 01-01-05 05:25 PM
Posting a question / answer on site markcody PHP 2 11-23-04 01:58 PM
[PHP] Array question UmiSal Script Requests 1 04-05-04 01:52 PM
question and answer software jaydifox C/C++ 0 02-21-04 09:26 AM
ADO Recordsets question vbNovice Visual Basic 0 12-22-03 10:25 PM


All times are GMT -5. The time now is 07:02 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.