[Help] How can I make mysql_pconnection(...) work?
Moderator: General Moderators
[Help] How can I make mysql_pconnection(...) work?
(Maybe it's another foolish question, but I almost don't know anything about "l+a+m+p", please help me)
I am using linux+apache+mysql+php solution.
In the scripts, there are codes like this:
<?php
@$c = mysql_pconnect("localhost", "root", "password") ;
print "ok?" ;
?>
But I found the "ok?" cannot be displayed. It seems somethings like an exception occurs when mysql_pconnect() is called.
I am sure that root's password is "password" and mysql runs ok.
So what's the problem.
Thanks a million!
I am using linux+apache+mysql+php solution.
In the scripts, there are codes like this:
<?php
@$c = mysql_pconnect("localhost", "root", "password") ;
print "ok?" ;
?>
But I found the "ok?" cannot be displayed. It seems somethings like an exception occurs when mysql_pconnect() is called.
I am sure that root's password is "password" and mysql runs ok.
So what's the problem.
Thanks a million!
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
try this:
Code: Select all
$c = @mysql_pconnect("localhost", "root", "password") or die("ERROR: ".mysql_error());-
TheBentinel.com
- Forum Contributor
- Posts: 282
- Joined: Wed Mar 10, 2004 1:52 pm
- Location: Columbus, Ohio
Is the user name and password sent to mysql_pconnect referring to the user login's on the O/S, or a separate list of users within MySQL? If it's a list of users in the database, maybe you don't have a user named "root" in your db.Illusionist wrote: $c = @mysql_pconnect("localhost", "root", "password") or die("ERROR: ".mysql_error());
Sorry if this is way off, I'm very new to MySQL.
I think there's a user named "root", after you install mysql for the first time, the user "root" is there and the password of root is "" at that point of time.TheBentinel.com wrote: If it's a list of users in the database, maybe you don't have a user named "root" in your db.
I am very new to MySql too, anyway, I've tried other accounts of mysql, the same thing happens.
Thank you anyway!
-
TheBentinel.com
- Forum Contributor
- Posts: 282
- Joined: Wed Mar 10, 2004 1:52 pm
- Location: Columbus, Ohio
What error message does it print?Illusionist wrote:try this:Code: Select all
$c = @mysql_pconnect("localhost", "root", "password") or die("ERROR: ".mysql_error());
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
are you sure you have PHP working on your server??
create a new php page(*.php) with only this in it:
and see if you get anything....
create a new php page(*.php) with only this in it:
Code: Select all
<?php
phpinfo()
?>-
TheBentinel.com
- Forum Contributor
- Posts: 282
- Joined: Wed Mar 10, 2004 1:52 pm
- Location: Columbus, Ohio
Maybe try mysql_connect? Looking at the docs that PB referenced, it looks like pconnect was a later addition that you may not have. (What version of PHP are you running?)river001 wrote:"Fatal Error: Call to undefined function:mysql_pconnect()...."
I think you'd get that error when you call any undefined function. If you changed it to mysql_NoSuchFunction, you'd probably get the same error.