Re: [PHP-DB] MySQL CONNECTION PROblem

2003-06-10 Thread nabil
but when i used mysql_error()  i got : "sorry database not found"
and i have privileges in mysql/ user table .. as shown below... the point is
if i changed 192.168.0.111 to localhost .. i managed to get the data ...

as my dbconnect.php file includes



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');

"George Patterson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 10 Jun 2003 16:47:26 +0300
> "nabil" <[EMAIL PROTECTED]> wrote:
>
> > 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");
> > ?>
>
> Nabil,
>
> Try changing the last line statement to
> mysql_select_db("kt") or die("sorry database not found". mysql_error());
>
> This will show what the error really is.
>
> Example, You have created the database haven't you??
> Try using the mysql client to connect from the web server to the mysql
> server.
>
> George Patterson



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



Re: [PHP-DB] MySQL CONNECTION PROblem

2003-06-10 Thread George Patterson
On Tue, 10 Jun 2003 16:47:26 +0300
"nabil" <[EMAIL PROTECTED]> wrote:

> 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");
> ?>

Nabil, 

Try changing the last line statement to  
mysql_select_db("kt") or die("sorry database not found". mysql_error());

This will show what the error really is. 

Example, You have created the database haven't you?? 
Try using the mysql client to connect from the web server to the mysql
server.

George Patterson

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



Re: [PHP-DB] MySQL CONNECTION PROblem

2003-06-10 Thread nabil
but when i used mysql_error()  i got : "sorry database not found"

as my dbconnect.php file includes



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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > i have the dbconnect.php as :
> > //
> >  > 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



RE: [PHP-DB] MySQL CONNECTION PROblem

2003-06-09 Thread John W. Holmes
> i have the dbconnect.php as :
> //
>  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



[PHP-DB] MySQL CONNECTION PROblem

2003-06-09 Thread nabil
i have the dbconnect.php as :
//

///
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?

Regards
nabil





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



[PHP-DB] mysql connection problem

2002-05-18 Thread Christian Weilbach

hi
i've added a new apache 2.0.35 server with an php 4.2.0 module to my
machine, but always when this php-module tries to connect my mysql server
(on the same machine) this error:

Host 'weilbach' is not allowed to connect to this MySQL server

appears. my other apache 1.3.23 server with php 4.1.2 works perfectly. i've
tried to use the same php.ini file but it doesn't help...
i would be very happy if some one can help me

christian weilbach



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




Re: [PHP-DB] mySQL connection problem

2001-04-29 Thread winescout

Check to see that mySQL is running on your system.  On mine, when it is not,
I get an error just like that.
Matt

""LENNART KARLSSON"" <[EMAIL PROTECTED]> wrote in message
9cefep$4pu$[EMAIL PROTECTED]">news:9cefep$4pu$[EMAIL PROTECTED]...
> Hi!
> I have a problem when I try to use a mySQL connection.
> I run Win98SE, PWS 4 and php4. php is working.
>
> When I try to run any mySQL scripts (v this one is a forum from
> planet-source-code.com) I get this error:
>
> Running:   mysql_pconnect("localhost","root");   -->
> Warning: Can't connect to MySQL server on 'localhost' (10061) in x.php
> on line xx.
>
> What am I doing wrong?
>
> /Eric
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] mySQL connection problem

2001-04-28 Thread LENNART KARLSSON

Hi!
I have a problem when I try to use a mySQL connection.
I run Win98SE, PWS 4 and php4. php is working.

When I try to run any mySQL scripts (v this one is a forum from
planet-source-code.com) I get this error:

Running:   mysql_pconnect("localhost","root");   -->
Warning: Can't connect to MySQL server on 'localhost' (10061) in x.php
on line xx.

What am I doing wrong?

/Eric



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MySQL connection problem - need help from expert

2001-03-22 Thread Ian

Thanks, Thor and Cal  ; )


"Ian" <[EMAIL PROTECTED]> wrote in message
99eaaj$njn$[EMAIL PROTECTED]">news:99eaaj$njn$[EMAIL PROTECTED]...
> Please help me !!!
>
> Description :-
> Server 1 is installed MySQL which located in US.
> Server 2 is located in Singapore, and doesn't install Mysql.
> Both of them are installed PHP and Acaphe.
>
> Case:-
> I would like to set the server 2 connect to Server 1's MySQL database.
What
> should I do?
>
> Thank you in advance.
> Ian.
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL connection problem - need help from expert

2001-03-22 Thread Cal Evans

Greetings and Salutations Ian,

Somewhere in your code you are going to have a line similar to this:
$currentConnection = mysql_connect ($server, $userName,$password)

$server is going to be either the name or the IP address of your server
$userName is going to be the MySQL user name you use to connect to MySQL
$password is going to be the password for your username.

an example would be:
$currentConnection = mysql_connect ('192.168.0.1', 'foo','bar');

This would create a connection to a MySQL server on 192.168.0.1 for user foo
with password bar and store it in $currentConnection for you to use.

This assumes that:
1: There IS a MySQL server on 192.168.0.1
2: That it is running on the standard port. (3306?)
3: That [EMAIL PROTECTED] has an account on that server
4: That foo's password is bar.

HTH,
Cal
http://www.calevans.com


-Original Message-
From: Ian [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 7:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL connection problem - need help from expert


Please help me !!!

Description :-
Server 1 is installed MySQL which located in US.
Server 2 is located in Singapore, and doesn't install Mysql.
Both of them are installed PHP and Acaphe.

Case:-
I would like to set the server 2 connect to Server 1's MySQL database. What
should I do?

Thank you in advance.
Ian.



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] MySQL connection problem - need help from expert

2001-03-22 Thread Thor M. Steindorsson

In the 'user' table in the 'mysql' database on server1, you need to insert
the username you'll be using to connect (and the encrypted password), and in
the Host field you have to specify the hostname of server2, as well as what
privileges you want that user to have (I recommend nn, then
specify in the db table which database the user is allowed to connect to and
what he can do to it).  Then flush privileges, and you're set.
Of course, you'll have to have root access to the mysql server to make these
changes.

Cheers,
Thor.

PS. As much as I hate to use the RTFM quote (the 'rtfm' reply rubs me the
wrong way and is one of the biggest deterrents for new users of GPL
software, most people ask because they can't find the info, so rtfm is
unecessarily rude), I'll bet you this is explained in better detail in the
mysql documentation.  So, I won't actually say it, but merely imply it...

> -Original Message-
> From: Ian [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 22, 2001 5:50 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] MySQL connection problem - need help from expert
>
>
> Please help me !!!
>
> Description :-
> Server 1 is installed MySQL which located in US.
> Server 2 is located in Singapore, and doesn't install Mysql.
> Both of them are installed PHP and Acaphe.
>
> Case:-
> I would like to set the server 2 connect to Server 1's MySQL
> database. What
> should I do?
>
> Thank you in advance.
> Ian.
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL connection problem - need help from expert

2001-03-22 Thread Ian

Please help me !!!

Description :-
Server 1 is installed MySQL which located in US.
Server 2 is located in Singapore, and doesn't install Mysql.
Both of them are installed PHP and Acaphe.

Case:-
I would like to set the server 2 connect to Server 1's MySQL database. What
should I do?

Thank you in advance.
Ian.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]