Previous Thread
Next Thread
Print Thread
Rate Thread
#253076 07/06/2003 2:23 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I was trying out PhpAdsNew on my home computer test site. Everything is fine except that the ad program connects to its own database and does not switch back.

This is the code phpadsnew gives


if (@include(getenv('DOCUMENT_ROOT').'/phpAdsNew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 2, '_blank', '', '1', $phpAds_context);
echo $phpAds_raw['html'];
}


I have tried this

mysql_close($phpAds_raw);

Any ideas how to terminate the connection so Threads can connect to its own database.

Sponsored Links
sf49rminer #253077 07/06/2003 3:10 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
If the databases are on the same server, you don't need (or want) to close the connection to switch to a different database. That's done by:

mysql_select_db('database_name') or die("Could not select database 'database_name'\n");

If you do want to close the connection, you would call mysql_close() with no parameters, in which case it closes the last opened connection, or pass it the link identifier returned by mysql_connect().

mysql_close

joeuser #253078 07/06/2003 4:18 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Thanx I tried the mysql_close ()

mysql_select_db('database_name') or die("Could not select database 'database_name'\n");

The above works fine thanx.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)