Re: MySQL CONNECTION PROblem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



but when i used mysql_error()  i got : "sorry database not found"

as my dbconnect.php file includes

<?
mysql_connect("192.168.0.111" , "root" , "password") or die("SORRY CANNOT
CONNECT") ;
mysql_select_db("kt") or
die("sorry database not found");
?>

and the user table of mysql database :
#
# Dumping data for table `user`
#

INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'Y', 'N', 'N', 'N');
INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'N', 'N', 'N', 'N');

so it has the '%' value so it can be accessed by any host.!!!1

any comment ???


"John W. Holmes" <holmes072000@charter.net> wrote in message
002401c32e7d$5a5f4a90$7c02a8c0@coconut">news:002401c32e7d$5a5f4a90$7c02a8c0@coconut...
> > i have the dbconnect.php as :
> > //////////////////
> > <?php
> > mysql_connect("192.168.0.111" , "root" , "pass") or
> > die ("Couldn't connect to database");
> > mysql_select_db("DatabaseName") or
> > die("sorry database not found");
> > ?>
> > ///////////////////
> > when i  put localhost instead of the IP address of my machine (localy)
> i
> > got
> > the following error...
> >
> > Warning: mysql_num_rows(): supplied argument is not a valid MySQL
> result
> > resource in c:\inetpub\wwwroot\kt\superv_list.php on line 5
> > No Data Found..
> >
> > what is my problem, this was a test to connect to my database on the
> same
> > machine . but i replaced the "localhost" with my machine IP address..
> do i
> > have to put a domain name instead of an IP if i want to connect to a
> > remote
> > server on the internert?
>
> Your query failed. Use mysql_error() to find out why.
>
> ---John W. Holmes...
>
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux