#1
  1. No Profile Picture
    Projecto EINet
    Guest
    Devshed Newbie (0 - 499 posts)
    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. #2
  3. No Profile Picture
    moderator
    Guest
    Devshed Newbie (0 - 499 posts)
    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)
  4. #3
  5. No Profile Picture
    faisalkhan
    Guest
    Devshed Newbie (0 - 499 posts)
    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
  6. #4
  7. No Profile Picture
    bnyi
    Guest
    Devshed Newbie (0 - 499 posts)
    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
  8. #5
  9. No Profile Picture
    Ulf.Wendel
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi bnyi,

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

    BTW what does bnyi stand for?

    Ulf

Similar Threads

  1. Replies: 5
    Last Post: January 28th, 2004, 09:46 AM
  2. can't connect to mysql server
    By tentonipete in forum MySQL Help
    Replies: 3
    Last Post: October 6th, 2003, 03:42 AM
  3. Errcode:13 . How to solve it on MySQL + Windows 2000
    By hankycheng in forum MySQL Help
    Replies: 28
    Last Post: August 3rd, 2003, 11:05 AM
  4. Beginner: Cannot connect to MySQL
    By databasiqs in forum MySQL Help
    Replies: 0
    Last Post: December 27th, 2002, 02:16 AM
  5. Unable to connect to mySQL server
    By blueprint in forum MySQL Help
    Replies: 1
    Last Post: February 13th, 2002, 10:02 AM

IMN logo majestic logo threadwatch logo seochat tools logo