[Techtalk] MySQL & PHP upgrade issues

Davis, Jennifer JDavis at JUSTICE.GC.CA
Fri Jul 12 14:54:00 EST 2002


James:

	Thank you so much for your help.

------

Warning: Host 'soleil.jenn.ca' is not allowed to connect to this MySQL
server in /var/www/htdocs/scc/output.php on line 46

Warning: MySQL Connection Failed: Host 'soleil.jenn.ca' is not allowed to
connect to this MySQL server in /var/www/htdocs/scc/output.php on line 46

Unable to connect to the database server at this time.

------


Upon discovering this, it was easy to fix the problem getting in to the
database.  I just granted all permissiions to root at soleil.jenn.ca


Now I am getting a second error.


---------
new search
modify exisiting results
Warren's Collection , Nancy's Collection , HRLS Collection

Sort by order published , alphabetically English , alphabetically French ,
date of judgment

Print with headnotes , without ,

>From first volume of to last volume of

Error performing query:
Case/ Arret

-----

The code for that part of the script is below:



if ($order=="D")
{
$result = mysql_query("SELECT * FROM cases WHERE (title_e like '%$term%' or
title_f like '%$term%' or headnote_e like '%$term%' or headnote_f like
'%$term%')$

}

if ($order=="N")
{
$result = mysql_query("SELECT * FROM cases WHERE (title_e like '%$term%'
or title_f like '%$term%' or headnote_e like '%$term%' or headnote_f like
'%$term%') and (nancy== 'Y' and warren == 'N') ORDER by year,volume,page");

}
/*
for error checking
$result = mysql_query("SELECT * FROM cases ORDER by year,volume,page");
*/

if (!$result)
{
echo("<P>Error performing query: ".mysql_error()."</P>");
exit();
}


-----

It seems that the both the variables are not getting passed to the script
properly and the database is not getting read at all.  If I remove the
comment around:

/*
for error checking
$result = mysql_query("SELECT * FROM cases ORDER by year,volume,page");
*/

Then I get no results.  I am starting to worry now.  This problem is above
my head.  I am not looking forward to entering another 500KB of data with a
new database...

Thanks for the help so far.  

Jenn







-----Original Message-----
From: James [mailto:james at james-web.net]
Sent: 2002 Jul 12 12:14 PM
To: 'Davis, Jennifer'; techtalk at linuxcchix.org
Subject: RE: [Techtalk] MySQL & PHP upgrade issues


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

// Connect to the database server

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

$dbselect= mysql_select_db("scc");

?>

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