• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Need Urgent Help in MySQL

2cool2

b&
b&
<?php
$maxthreads = 6;
$dbservertype="mysql";
$servername="xxxxxx";
$dbusername="xxxxx";
$dbpassword="xxxxx";
$dbname="xxxxx";
$pwdincp=0;
$technicalemail = "xxx@xxx.com";
$usepconnect = 1;

$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$query = "SELECT * FROM thread ORDER BY lastpost DESC LIMIT $maxthreads";
$resultlatest = mysql_query($query,$db);
while ($latest_array = mysql_fetch_array($resultlatest)) {
echo "<b><a target=new href=\"http://www.domain.com/forum/showthread.php?threadid=$latest_array[threadid]\">$latest_array[title]</a><br><br></b>";
}
?>

---------------------------------------------

My Question
The script is opening a session with MySQL, Is it closing it?
Yes or No? If No, How to make the script close the session?

Thanks you very much!
 
Since you're using mysql_connect(), it automatically closes at the end of the script...
 
Are you sure :)?

Because where my site is hosted some one opens a session and does not close it

And my host have sent a mail to every one to check if it is their script is causing the problme and if it is not sloved they will find out who is doign it and dellete his site :(

So i dont want my site to close down!

I just use 2 things
1. a vBulletin forum 2.2.2 (I have around 10-35 people online at any tiem of day)
2. and the script which is posted above

So are you sure it is not my script which is opening sessions and not closing it :)

I just want to be sure :)
 
Try looking it up on php.net, I know there is a mysql_close() or a mysql_disconnect() of some sort...
 
it closes automatically... just go through all your scripts and replace any occurence of mysql_pconnect with mysql_connect and you're all good...
 
Back
Top