[Techtalk] MySQL & PHP upgrade issues

James james at james-web.net
Fri Jul 12 12:16:55 EST 2002


Jen, I'd suggest removing the "@" before the mysql_connect and
mysql_select_db.

"@" causes all raw errors to be silenced.  It works great in a
production site because you can show friendly errors to people, but for
debugging, it stinks.

Try this:

<?php

$dbcnx = mysql_connect("localhost","root","password") or
die(mysql_error());

$dbselect= mysql_select_db("scc") or die(mysql_error());

?>

That will show all "raw" errors.  Let me know what it says.

- James

> -----Original Message-----
> From: techtalk-admin at linuxchix.org 
> [mailto:techtalk-admin at linuxchix.org] On Behalf Of Davis, Jennifer
> Sent: Friday, July 12, 2002 11:56 AM
> To: 'techtalk at linuxcchix.org'
> Subject: [Techtalk] MySQL & PHP upgrade issues
> 
> 
> Hi:
> 
> On the weekend I backed up my system and upgraded Slackware 
> 8.0 to 8.1, (really, I wiped the hard disk & reinstalled).  I 
> installed PHP 4.2 from source and MySQL 3.23.51 from the 
> MySQL binaries from www.mysql.com.  The problem is that PHP 
> cannot seem to connect to MySQL from PHP.
> 
> The site I am trying to reach is below.  All I get is following error:
> 
> Unable to connect to the database server at this time
> 
http://brain.jenn.ca/scc/output.php?term=view_entire_database&W=Y&N=Y&H=
Y&or
der=Y&headnotes=with&from=1970&to=2002



Below is the snippet of code.  I have replaced my real password with the
word password.  I have tried connecting without a password

</TITLE>
<HEAD>
<BODY>
<?php

// Connect to the database server

$dbcnx = @mysql_connect("localhost","root","password");
if (!$dbcnx)
{
echo( "<P>Unable to connect to the database server at this time.</P>" );
exit(); }

//line 50

// Select the caselaw database
if (! @mysql_select_db("scc") )
{
echo( "<P>Unable to locate the caselaw database database at this
time.</P>" ); exit(); }


I'm able to enter the database from the command line no problem, I can
view the database.  For some reason, I just can't connect to the
database server from php.  I really hope this is something simple that I
have overlooked, like a permission or something like that.  Any help
would be appreciated.



> Jennifer Davis
> Constitutional & Administrative Law - Droit administratif & 
> constitutionnel Department of Justice Canada - Ministère de la Justice

> du Canada
> *(613) 957-4963 - fx (613) 941-1937
> *jdavis at justice.gc.ca
> 
_______________________________________________
Techtalk mailing list
Techtalk at linuxchix.org
http://mailman.linuxchix.org/mailman/listinfo/techtalk




More information about the Techtalk mailing list