
June 30th, 1999, 06:30 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
The MySQL and PHP3 are installed in my ISP and I do not have access to the server's installation.
I've builded a file with the following code:
-------------------------
<HTML><HEAD>
<?php
//********
//** Definition of connect variables
//********
$servname = "rumos.com";* // My ISP MySQL Server Name
$usrname = "user1";* // My MySQL Username
$passwd = "password";* // My MySQL Password
?>
<TITLE>DB List for <?php $usrname ?></TITLE>
</HEAD>
<BODY>
<?php
//********
//** Here I try to connect to server
//********
$link = mysql_connect($servname,$usrname,$passwd);
if (! $link):
* echo "<H1>", $usrname, " - It's not possible to connect to* MySQL Server: ", $servname,"</H1>n";
* echo mysql_error();
?>
</BODY>
</HTML>
<?php
* exit; // Exit on error.
endif;
//********
//** Here* I* recolect* the names of all databases I've acess
//********
$db = mysql_listdbs();
?>
<CENTER><TABLE WIDTH="80%">
<TR><TH BGCOLOR="FFCC00"><FONT COLOR="Navy">Database Name</FONT></TH></TR>
<?php
//********
//** Loop to show DB names.
//********
for ($i = 0; $i < php3_mysql_numrows($db); $i++):
** echo "<TR><TD><FONT FACE="Arial, Verdana, sans-serif" SIZE=2>", mysql_dbname($db,$i), "</FONT></TD></TR>n";
endfor;
?>
</TABLE></CENTER>
<?php
//********
//** Closing connection to MySQL.
//********
mysql_close($link);
?>
</BODY>
</HTML>
-------------------------
When I run it return this:
-------------------------
Warning: MySQL Connection Failed: Unknown MySQL error in /www/rumos1/lopo/testes/teste.php3 on line 24
rumos1 - It's not possible to connect to MySQL Server: rumos.com
-------------------------
Can someone tell me what am I doing wrong?
Best regards,
Lopo
------------------
Projecto EINet
|