MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 30th, 1999, 06:30 AM
Projecto EINet
Guest
Dev Shed Newbie (0 - 499 posts)
 
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

Reply With Quote
  #2  
Old July 27th, 1999, 03:14 PM
moderator
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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)

Reply With Quote
  #3  
Old September 8th, 1999, 05:41 AM
faisalkhan
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #4  
Old October 27th, 1999, 03:20 AM
bnyi
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #5  
Old October 27th, 1999, 04:32 AM
Ulf.Wendel
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi bnyi,

uncomment the line ";extension = mysql.dll" or place dl("mysql.dll"); in your script.

BTW what does bnyi stand for?

Ulf

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > MySQL + PHP3 gives Unknown Error on Connect

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap