zzapper wrote:
On Mar 14, 3:38 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
>zzapperwrote:
>>Hi,
At present at the top of each of my php pages I reconnect to my
database
mysql_connect(...);
is that actually necessary/good practice. Isn't there something about
persistent connections.
--
zzapper
Best of VimTips
http://www.vim.org/tips/tip.php?tip_id=305
You do NOT want to use mysql_pconnect(). This does create persistent
Hi
So is it normal to connect to the db once per page, the reason I ask
this is that I'm getting "you gave exceeded the maximum number of
connections per hour (400)" from my webserver, but I'm currently to
only one accessing it!
Does "require once" only prevent me from connecting more than once per
page?
--
zzapper
Best of VimTips
http://www.vim.org/tips/tip.php?tip_id=305
No, every page must make its own connection to the server. At the end
of the page, that connection will be closed by the PHP cleanup if you
don't do it yourself.
What's not clear is if this is your server or a shared host. If this is
your own server, you need to change your MySQL setup (try
comp.databases.mysql for help). If this is a hosted server, you need to
talk to your host.
But if I were in this position on a hosted server, I'd find another
host. 400 connections per hour is nothing. And if that's what they
limit you to, chances are they're overselling their servers.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================