|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
This may not be the problem that your having, but you should make sure your ISP has all the permissions set properly. MySQL has a confusing method of setting permissions (that is it is confusing until you get to know it of course)
|
|
#3
|
|||
|
|||
|
Hi,
Iv checked your code on my local computer and it was giving error. Then I changed your php3_mysql_numrows () method with following method and it worked and showed the databases on my local computer. Method I used was : mysql_num_rows () Just change your old method with the above one and see what happens. Regards, Faisal Khan http://redrival.com/faisal |
|
#4
|
|||
|
|||
|
I have a similar error...I'm running MySql on NT, php3, IIS 4.0 and when I use the function mysql_connect, I've a Fatal Error: Undefined function mysql_connect()....
Knows somebody the answer to my question? bNYi. bnyi@canaryweb.es ------------------ by bNYi e-mail: bNYi@canaryweb.es |
|
#5
|
|||
|
|||
|
Hi bnyi,
uncomment the line ";extension = mysql.dll" or place dl("mysql.dll"); in your script. BTW what does bnyi stand for? Ulf |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > MySQL + PHP3 gives Unknown Error on Connect |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|