473,395 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Permanent MySQL Connection

TheServant
1,168 Expert 1GB
Hey guys
Long time no see, hope you are all well. Been pretty busy at work, so not much time to continue all my programming adventures!

I do however want to re-focus on it and I was wondering if there is any extra danger I should know about in using a permanent connection (only have to connect to the db once by replacing mysql_connect with mysql_pconnect)?
Jun 30 '08 #1
5 2692
pbmods
5,821 Expert 4TB
Heya, TheServant.

Check out the comments on the PHP manual page for mysql_pconnect() (http://php.net/mysql_pconnect).

Especially this one (http://php.net/manual/en/function.my...nect.php#39599).

Also note that SQL variables and temporary tables might not work the way you expect them to; connections will be persistent but that does not mean that mysql_pconnect() will return the same one every time!.
Jul 1 '08 #2
TheServant
1,168 Expert 1GB
Cheers. So from that second link, the general feel is you shouldn't use it unless you have to? I am connecting on every page and grabbing data from tables at the beginning too. I won't change the data grabbing, but I just figured it would be more efficient to have a permanent connection?

From the php manual it seems to suggest there is no efficiency advantages? Can I just get someone to confirm this before I forget about using it?
Jul 1 '08 #3
pbmods
5,821 Expert 4TB
Check out this article (http://www.mysql.com/news-and-events...000000086.html).
Jul 1 '08 #4
TheServant
1,168 Expert 1GB
Sold. Thanks for your help, I will remember what I have learned but not use this, for the simple reason it does not improve what I wanted to improve.

The Servant
Jul 1 '08 #5
pbmods
5,821 Expert 4TB
We aim to please.

Good luck with your project, and if you ever need anything, post back anytime (:
Jul 2 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
1
by: zMisc | last post by:
I am looking at using MySQL in my application (currently works with Access and SQL Server 2000). Is it possible to access MySQL database using ADO? What is the connection string for this? ...
1
by: Ismail Demiralp | last post by:
Hi, I want to open a permanent socket connection to a service witch is running on the same computer. After I logged in on my php page, I start a session. After this a socket connection should...
7
by: Ike | last post by:
Let's say I have a MySQL 4.12 database, opened to the internet on 111.111.111.111 allowing all incoming and outgoing ports. I have a username and password setup, which CAN connect to this database,...
5
oll3i
by: oll3i | last post by:
my librarybean package library.ejb; import java.sql.*; import javax.ejb.*; import library.common.*; @Stateless @Remote
3
by: tulika dutta | last post by:
after 8 hrs my MySQL connection with JDBC gets time out. It gives the error java.sql.SQLException: No operations allowed after connection closed.Connection was implicitly closed due to underlying...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.