[PHP4BETA] MySQL - Problem with connect? (Historical PHP3 code)...
| From: | Karl Pielorz | Date: | Thu, 15 Apr 1999 23:11:49 +0000 |
| Subject: | [PHP4BETA] MySQL - Problem with connect? (Historical PHP3 code)... | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-113@lists.php.net to get a copy of this message | ||
Hi,
I've now got PHP4 running OK, and I've just tried running our first piece of
existing code, which keeps bombing out with:
"
Warning: 1 is not a MySQL link index in ./include/stddb.php on line 150
Failed to connect / login to the map database. :0
"
The code causing this is:
"
/* 'x's replace the real details in this email */
$SQLDB_ServerName = "xxxxxxxxxx";
$SQLDB_UserName = "xxxxx";
$SQLDB_Password = "";
$SQLDB_DBName = "xxxxxxxxxx";
/* Connect to the Map Database */
$MainDB = mysql_connect( $SQLDB_ServerName, $SQLDB_UserName, $SQLDB_Password
);
if( $MainDB == false ){
sql_fail( "Connecting to Map DB" );
}
$Temp = mysql_select_db( $SQLDB_DBName, $MainDB );
/* Error if we can't connect */
if( $Temp == false ){
echo( "Failed to connect / login to the map database.\n" );
echo( mysql_error().":".mysql_errno() );
exit();
}
"
If this is a result of bad code - or the new boolean state of true & false (or
something else equally as silly), my appologies (I am going to bed now!)...
The code above is historical - it may be a case of "it's wrong, but it worked
before - which doesn't make it right" - if you get what I mean...
The above works OK on PHP 3.0.6
-Karl
--
PHP 4 Beta