Re: [PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
That makes complete sense. 
Thank you Joshua.

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com




> On Mar 5, 2017, at 6:44 PM, Arneson, Joshua  wrote:
> 
> If you have multiple calls to the database that are grouped, definitely 
> perform them during the same connection session. The bottom line is unless 
> the overhead associated with opening and closing the connection is going to 
> be an issue programmatically, keep connections brief and group your 
> transactions where possible. A good example would be you have a group of 
> calls (A, B, C) that need to happen. Calls A and B can run one after the 
> other, but C has to wait on a user input (no matter how small/simple), you 
> should open the connection, run calls A and B, close the connection waiting 
> on user input, then reopen, run call C, then close the connection. A good 
> exception to this rule would be if you have calls that have to run every 'x' 
> milliseconds and you anticipate that you MIGHT at ANY point run into 
> concurrency issues, you would hold a single open connection for that specific 
> case and adhere to the 'open'-'run calls'-'close' standard for all other 
> cases. Remember, we rarely know what new tasks our programs will be doing in 
> the future so building for scalability is always a good bet. 
> 
> Respectfully,
> 
> Joshua D. Arneson
> Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR)
> 130 W Kingsbridge Rd, Rm 5F-04
> Bronx, NY 10468
> Email: joshua.arne...@mssm.edu
> Office: 718-584-9000 ext 6094
> Mobile: 347-915-8911
> Fax: 718-741-4746
> 
>> On Mar 5, 2017, at 7:29 PM, Karl DeSaulniers  wrote:
>> 
>> Ah, thanks for the reply Joshua.
>> 
>> Duly noted. So when is it bad to make multiple open and close connections 
>> then?
>> I am guessing that could have some impact with lots of users too. Yes?
>> 
>> If the website in question does not have a lot of users (less than 1,000), 
>> is this still a bad call to keep an open connection?
>> If so, should I be closing the connection after each page load that has 
>> multiple calls on the database?
>> Or after each call to the database? 
>> 
>> I am wanting to make sure I am not doing something bad or dangerous when 
>> holding these sessions open.
>> If it is a matter of taste, I'll leave it, but if it is a matter of best 
>> practices to open and close, I will change the method I am using.
>> 
>> Again, TIA!
>> 
>> Best,
>> 
>> Karl DeSaulniers
>> Design Drumm
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__designdrumm.com=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=w7VxdOhlxCY27A_sfaFCxntsWMG8ZDA3nukN6fBstsA=JzvStr8fa_OyNaHOUe0Xp8_o6aDzZSgZ6OXyEk6WyIM=
>> 
>> 
>> 
>> 
>>> On Mar 5, 2017, at 6:19 PM, Arneson, Joshua  wrote:
>>> 
>>> Right off the bat, you need to consider concurrency issues. Depending on 
>>> the size of your user base and level of activity this could become a major 
>>> issue. In the end, why hold an open connection for 15 minutes just to 
>>> process 20-30 transactions that take 20-30ms each? Just better (under most 
>>> circumstances) to open the connection, process your transaction , then 
>>> close the connection. 
>>> 
>>> Respectfully,
>>> 
>>> Joshua D. Arneson
>>> Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR)
>>> 130 W Kingsbridge Rd, Rm 5F-04
>>> Bronx, NY 10468
>>> Email: joshua.arne...@mssm.edu
>>> Office: 718-584-9000 ext 6094
>>> Mobile: 347-915-8911
>>> Fax: 718-741-4746
>>> 
 On Mar 5, 2017, at 6:54 PM, Karl DeSaulniers  wrote:
 
 Hello everyone,
 Long time. Hope all are well.
 
 Quick question. How should MySQL connections be treated?
 Is it ok to leave them open or is it better to close them after 
 transactions?
 I have a website that uses sessions and was wondering if there was any 
 situations where I should be closing the connection.
 Either for performance reasons or security or best practices. 
 
 Just wondering your professional.
 
 TIA
 
 Best,
 
 Karl DeSaulniers
 Design Drumm
 https://urldefense.proofpoint.com/v2/url?u=http-3A__designdrumm.com=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=09oI7Bn2rpePGXSl8CmHMTUqhm3Rjh676OnMYed0L_4=JBoK9bslzQegAxQDG_NbsuvcCBLw5_LIQkjMpEj4kE8=
  
 
 
 
 
 
>>> 
>>> --
>>> PHP Database Mailing List 
>>> (https://urldefense.proofpoint.com/v2/url?u=http-3A__www.php.net_=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=w7VxdOhlxCY27A_sfaFCxntsWMG8ZDA3nukN6fBstsA=wWlQEGEfTaOWZtdTA776DTMosB5WtSX6K5iaiWM7J3A=
>>>  )
>>> To unsubscribe, visit: 
>>> 

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Arneson, Joshua
If you have multiple calls to the database that are grouped, definitely perform 
them during the same connection session. The bottom line is unless the overhead 
associated with opening and closing the connection is going to be an issue 
programmatically, keep connections brief and group your transactions where 
possible. A good example would be you have a group of calls (A, B, C) that need 
to happen. Calls A and B can run one after the other, but C has to wait on a 
user input (no matter how small/simple), you should open the connection, run 
calls A and B, close the connection waiting on user input, then reopen, run 
call C, then close the connection. A good exception to this rule would be if 
you have calls that have to run every 'x' milliseconds and you anticipate that 
you MIGHT at ANY point run into concurrency issues, you would hold a single 
open connection for that specific case and adhere to the 'open'-'run 
calls'-'close' standard for all other cases. Remember, we rarely know what new 
tasks our programs will be doing in the future so building for scalability is 
always a good bet. 

Respectfully,

Joshua D. Arneson
Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR)
130 W Kingsbridge Rd, Rm 5F-04
Bronx, NY 10468
Email: joshua.arne...@mssm.edu
Office: 718-584-9000 ext 6094
Mobile: 347-915-8911
Fax: 718-741-4746

> On Mar 5, 2017, at 7:29 PM, Karl DeSaulniers  wrote:
> 
> Ah, thanks for the reply Joshua.
> 
> Duly noted. So when is it bad to make multiple open and close connections 
> then?
> I am guessing that could have some impact with lots of users too. Yes?
> 
> If the website in question does not have a lot of users (less than 1,000), is 
> this still a bad call to keep an open connection?
> If so, should I be closing the connection after each page load that has 
> multiple calls on the database?
> Or after each call to the database? 
> 
> I am wanting to make sure I am not doing something bad or dangerous when 
> holding these sessions open.
> If it is a matter of taste, I'll leave it, but if it is a matter of best 
> practices to open and close, I will change the method I am using.
> 
> Again, TIA!
> 
> Best,
> 
> Karl DeSaulniers
> Design Drumm
> https://urldefense.proofpoint.com/v2/url?u=http-3A__designdrumm.com=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=w7VxdOhlxCY27A_sfaFCxntsWMG8ZDA3nukN6fBstsA=JzvStr8fa_OyNaHOUe0Xp8_o6aDzZSgZ6OXyEk6WyIM=
> 
> 
> 
> 
>> On Mar 5, 2017, at 6:19 PM, Arneson, Joshua  wrote:
>> 
>> Right off the bat, you need to consider concurrency issues. Depending on the 
>> size of your user base and level of activity this could become a major 
>> issue. In the end, why hold an open connection for 15 minutes just to 
>> process 20-30 transactions that take 20-30ms each? Just better (under most 
>> circumstances) to open the connection, process your transaction , then close 
>> the connection. 
>> 
>> Respectfully,
>> 
>> Joshua D. Arneson
>> Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR)
>> 130 W Kingsbridge Rd, Rm 5F-04
>> Bronx, NY 10468
>> Email: joshua.arne...@mssm.edu
>> Office: 718-584-9000 ext 6094
>> Mobile: 347-915-8911
>> Fax: 718-741-4746
>> 
>>> On Mar 5, 2017, at 6:54 PM, Karl DeSaulniers  wrote:
>>> 
>>> Hello everyone,
>>> Long time. Hope all are well.
>>> 
>>> Quick question. How should MySQL connections be treated?
>>> Is it ok to leave them open or is it better to close them after 
>>> transactions?
>>> I have a website that uses sessions and was wondering if there was any 
>>> situations where I should be closing the connection.
>>> Either for performance reasons or security or best practices. 
>>> 
>>> Just wondering your professional.
>>> 
>>> TIA
>>> 
>>> Best,
>>> 
>>> Karl DeSaulniers
>>> Design Drumm
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__designdrumm.com=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=09oI7Bn2rpePGXSl8CmHMTUqhm3Rjh676OnMYed0L_4=JBoK9bslzQegAxQDG_NbsuvcCBLw5_LIQkjMpEj4kE8=
>>>  
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> --
>> PHP Database Mailing List 
>> (https://urldefense.proofpoint.com/v2/url?u=http-3A__www.php.net_=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=w7VxdOhlxCY27A_sfaFCxntsWMG8ZDA3nukN6fBstsA=wWlQEGEfTaOWZtdTA776DTMosB5WtSX6K5iaiWM7J3A=
>>  )
>> To unsubscribe, visit: 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.php.net_unsub.php=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=w7VxdOhlxCY27A_sfaFCxntsWMG8ZDA3nukN6fBstsA=qSyyKaFDMntOGvbZ-jgs6sfh-DyfkxT3tTOLa-uFDDw=
>>  
> 
> 
> --
> PHP Database Mailing List 
> 

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
Ah, thanks for the reply Joshua.

Duly noted. So when is it bad to make multiple open and close connections then?
I am guessing that could have some impact with lots of users too. Yes?

If the website in question does not have a lot of users (less than 1,000), is 
this still a bad call to keep an open connection?
If so, should I be closing the connection after each page load that has 
multiple calls on the database?
Or after each call to the database? 

I am wanting to make sure I am not doing something bad or dangerous when 
holding these sessions open.
If it is a matter of taste, I'll leave it, but if it is a matter of best 
practices to open and close, I will change the method I am using.

Again, TIA!

Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com




> On Mar 5, 2017, at 6:19 PM, Arneson, Joshua  wrote:
> 
> Right off the bat, you need to consider concurrency issues. Depending on the 
> size of your user base and level of activity this could become a major issue. 
> In the end, why hold an open connection for 15 minutes just to process 20-30 
> transactions that take 20-30ms each? Just better (under most circumstances) 
> to open the connection, process your transaction , then close the connection. 
> 
> Respectfully,
> 
> Joshua D. Arneson
> Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR)
> 130 W Kingsbridge Rd, Rm 5F-04
> Bronx, NY 10468
> Email: joshua.arne...@mssm.edu
> Office: 718-584-9000 ext 6094
> Mobile: 347-915-8911
> Fax: 718-741-4746
> 
>> On Mar 5, 2017, at 6:54 PM, Karl DeSaulniers  wrote:
>> 
>> Hello everyone,
>> Long time. Hope all are well.
>> 
>> Quick question. How should MySQL connections be treated?
>> Is it ok to leave them open or is it better to close them after transactions?
>> I have a website that uses sessions and was wondering if there was any 
>> situations where I should be closing the connection.
>> Either for performance reasons or security or best practices. 
>> 
>> Just wondering your professional.
>> 
>> TIA
>> 
>> Best,
>> 
>> Karl DeSaulniers
>> Design Drumm
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__designdrumm.com=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=09oI7Bn2rpePGXSl8CmHMTUqhm3Rjh676OnMYed0L_4=JBoK9bslzQegAxQDG_NbsuvcCBLw5_LIQkjMpEj4kE8=
>>  
>> >  >
>> 
>> 
>> 
>> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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



Re: [PHP-DB] MySQL connection

2017-03-05 Thread Arneson, Joshua
Right off the bat, you need to consider concurrency issues. Depending on the 
size of your user base and level of activity this could become a major issue. 
In the end, why hold an open connection for 15 minutes just to process 20-30 
transactions that take 20-30ms each? Just better (under most circumstances) to 
open the connection, process your transaction , then close the connection. 

Respectfully,

Joshua D. Arneson
Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR)
130 W Kingsbridge Rd, Rm 5F-04
Bronx, NY 10468
Email: joshua.arne...@mssm.edu
Office: 718-584-9000 ext 6094
Mobile: 347-915-8911
Fax: 718-741-4746

> On Mar 5, 2017, at 6:54 PM, Karl DeSaulniers  wrote:
> 
> Hello everyone,
> Long time. Hope all are well.
> 
> Quick question. How should MySQL connections be treated?
> Is it ok to leave them open or is it better to close them after transactions?
> I have a website that uses sessions and was wondering if there was any 
> situations where I should be closing the connection.
> Either for performance reasons or security or best practices. 
> 
> Just wondering your professional.
> 
> TIA
> 
> Best,
> 
> Karl DeSaulniers
> Design Drumm
> https://urldefense.proofpoint.com/v2/url?u=http-3A__designdrumm.com=DwIFAg=shNJtf5dKgNcPZ6Yh64b-A=HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk=09oI7Bn2rpePGXSl8CmHMTUqhm3Rjh676OnMYed0L_4=JBoK9bslzQegAxQDG_NbsuvcCBLw5_LIQkjMpEj4kE8=
>  
>   >
> 
> 
> 
> 

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



Re: [PHP-DB] MySQL connection

2003-07-15 Thread Lester Caine
I have:
WinNT_4.00 Server
Apache
PHP_5
MySQL_4
[myscript.php]
...
$link = mysql_pconnect();
...
-
If you run php.exe myscript.php,
you'll get message: Fatal error: Call to undefined function:
mysql_pconnect()...
HOW TO DECIDE THIS PROBLEM ?
Have you installed the php_mysql module in PHP5, it is not 
included by default now.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL connection

2003-07-15 Thread Igor
 Have you installed the php_mysql module in PHP5, it is not
 included by default now.

Where can I find this Library?



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



Re: [PHP-DB] MySQL Connection

2003-06-17 Thread Ramil G. Sagum
On Wed, 2003-06-18 at 08:16, [EMAIL PROTECTED] wrote:
 Hello,
 
 Would be grateful if someone couldkindly point me in the right direction.
 
 Whenever I try to connect to mysql server, I get these messsage back
 
 1.
 mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
 ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
 mysql
 
 2.
 mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
 ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
 mysql
 
something must be wrong with your connection string, would you post the
mysql_connect statement here.




 what could be wrong. Help please .
 
 Regards
 
 Moses
 
 


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



Re: [PHP-DB] MySQL Connection

2003-06-17 Thread John W. Holmes
[EMAIL PROTECTED] wrote:

Would be grateful if someone couldkindly point me in the right direction.

Whenever I try to connect to mysql server, I get these messsage back

1.
mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql
2.
mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql
what could be wrong. Help please .
1. This has nothing to do with PHP.

2. The user you connected to PHP with does not have permission to GRANT 
privileges.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  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-11 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

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

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 nabil
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 [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  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



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-09 Thread John W. Holmes
 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



Re: [PHP-DB] MySQL Connection Class

2002-01-30 Thread Dave Richardson


A number of connection classes and abstraction toolkits already exist.  Your
PHP 4.x install probably came with PEAR's DB.php abstraction layer.  Save
yourself the trouble perhaps?

jas said:
 So all I would need to do is create a file named db_connection.php3 and
 put in the functions $db =
 mysql_connection(localhost,username,password) or die(could not
 connect);
 and then put an include statement on the top of each page that needs
 the db connectiong?  Please correct me if I am wrong, I have never
 really used class files for my own scripts before.
 Thanks again.
 Gurhan Ozen [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Are you trying to write classes to connect to the database using PHP's
 native DB connection functions?? If yes, you should only check those
 database functions' tutorials and just use them inside your class..

 Gurhan


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 30, 2002 12:09 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MySQL Connection Class


 I know this may seem a little vague but I would like to know where a
 good tutorial on creating database connection class files would be.  I
 have
 been
 looking and as of yet I have not found one that deals specifically
 with
 this
 question.  Thanks in advance.
 Jas



 --
 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 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 Class

2002-01-30 Thread jas

Ok just to clear it up... our server is not running php4 unfortunately. =)
Dave Richardson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 A number of connection classes and abstraction toolkits already exist.
Your
 PHP 4.x install probably came with PEAR's DB.php abstraction layer.  Save
 yourself the trouble perhaps?

 jas said:
  So all I would need to do is create a file named db_connection.php3 and
  put in the functions $db =
  mysql_connection(localhost,username,password) or die(could not
  connect);
  and then put an include statement on the top of each page that needs
  the db connectiong?  Please correct me if I am wrong, I have never
  really used class files for my own scripts before.
  Thanks again.
  Gurhan Ozen [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Are you trying to write classes to connect to the database using PHP's
  native DB connection functions?? If yes, you should only check those
  database functions' tutorials and just use them inside your class..
 
  Gurhan
 
 
  -Original Message-
  From: jas [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, January 30, 2002 12:09 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] MySQL Connection Class
 
 
  I know this may seem a little vague but I would like to know where a
  good tutorial on creating database connection class files would be.  I
  have
  been
  looking and as of yet I have not found one that deals specifically
  with
  this
  question.  Thanks in advance.
  Jas
 
 
 
  --
  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 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 Class

2002-01-30 Thread Gurhan Ozen

Jas,
I can't know whether or not that's right for you. It all depends on what you
need to do.. If you only have one database connection with one userid/pass
combination, then yes it might be the solution you are looking for. But if
you want to  be able to reuse your code for different types of databases,
userids, then you can write a class with different functions and variables
to do so.
  For example you can something like
class myDBConnClass {
  var $user;
  var $pass;
  var $host;
  var $database;

   function setUser($username)
   {
   $this - user = $username;
   }
   function setPass($password)
   {
   $this - pass = $password;
   }
   function setHost($hostname)
   {
$this - host = $hostname)
   }
   function setDatabasename($databasename)
   {
$this  - database= $databasename;
   }

   function mySQLconn($username, $password, $hostname, $databasename)
   {
  mysql_pconnect($username, $password, $hostname);
  mysql_select_db($databasename);
}
function mySQL()
{
mysql_pconnect(($this - host)., .($this - user).,
.($this - pass). );
mysql_select_db($this - database);
}
 .
 .
 .
 .
   } // end of class myDBConnClass

   Say you have saved this into myDBConnClass.php .. Then in your php pages
you would first require this file with require(myDBConnClass.php);
statement, and then you would create another class extending this or just an
instance of this class (depending upon what you actually have in your class
and pages.
  Keep in mind that this is a very primitive and kind of useless class.. You
can always have more properties of the class and more functions..
  If you prefer you can hardcode the login, databasename info to the class
and call the connection fucntions without arguments, or you can set the
variables of the class and use it so, you can also have more functions to
connect to the different databases (PostGreSQL, Oracle, etc.) .
   Does this help???

Gurhan
-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 12:33 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Connection Class


So all I would need to do is create a file named db_connection.php3 and put
in the functions $db = mysql_connection(localhost,username,password)
or die(could not connect);
and then put an include statement on the top of each page that needs the db
connectiong?  Please correct me if I am wrong, I have never really used
class files for my own scripts before.
Thanks again.
Gurhan Ozen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Are you trying to write classes to connect to the database using PHP's
 native DB connection functions?? If yes, you should only check those
 database functions' tutorials and just use them inside your class..

 Gurhan


 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 30, 2002 12:09 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MySQL Connection Class


 I know this may seem a little vague but I would like to know where a good
 tutorial on creating database connection class files would be.  I have
been
 looking and as of yet I have not found one that deals specifically with
this
 question.  Thanks in advance.
 Jas



 --
 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 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 Class

2002-01-30 Thread jas

Yes it does, thanks... now that I have a better understanding of classes now
I just need to write one.  Thanks again.
jas
Gurhan Ozen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Jas,
 I can't know whether or not that's right for you. It all depends on what
you
 need to do.. If you only have one database connection with one userid/pass
 combination, then yes it might be the solution you are looking for. But if
 you want to  be able to reuse your code for different types of databases,
 userids, then you can write a class with different functions and variables
 to do so.
   For example you can something like
 class myDBConnClass {
   var $user;
   var $pass;
   var $host;
   var $database;

function setUser($username)
{
$this - user = $username;
}
function setPass($password)
{
$this - pass = $password;
}
function setHost($hostname)
{
 $this - host = $hostname)
}
function setDatabasename($databasename)
{
 $this  - database= $databasename;
}

function mySQLconn($username, $password, $hostname, $databasename)
{
   mysql_pconnect($username, $password, $hostname);
   mysql_select_db($databasename);
 }
 function mySQL()
 {
 mysql_pconnect(($this - host)., .($this - user).,
 .($this - pass). );
 mysql_select_db($this - database);
 }
  .
  .
  .
  .
} // end of class myDBConnClass

Say you have saved this into myDBConnClass.php .. Then in your php
pages
 you would first require this file with require(myDBConnClass.php);
 statement, and then you would create another class extending this or just
an
 instance of this class (depending upon what you actually have in your
class
 and pages.
   Keep in mind that this is a very primitive and kind of useless class..
You
 can always have more properties of the class and more functions..
   If you prefer you can hardcode the login, databasename info to the class
 and call the connection fucntions without arguments, or you can set the
 variables of the class and use it so, you can also have more functions to
 connect to the different databases (PostGreSQL, Oracle, etc.) .
Does this help???

 Gurhan
 -Original Message-
 From: jas [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 30, 2002 12:33 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] MySQL Connection Class


 So all I would need to do is create a file named db_connection.php3 and
put
 in the functions $db = mysql_connection(localhost,username,password)
 or die(could not connect);
 and then put an include statement on the top of each page that needs the
db
 connectiong?  Please correct me if I am wrong, I have never really used
 class files for my own scripts before.
 Thanks again.
 Gurhan Ozen [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Are you trying to write classes to connect to the database using PHP's
  native DB connection functions?? If yes, you should only check those
  database functions' tutorials and just use them inside your class..
 
  Gurhan
 
 
  -Original Message-
  From: jas [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, January 30, 2002 12:09 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] MySQL Connection Class
 
 
  I know this may seem a little vague but I would like to know where a
good
  tutorial on creating database connection class files would be.  I have
 been
  looking and as of yet I have not found one that deals specifically with
 this
  question.  Thanks in advance.
  Jas
 
 
 
  --
  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 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: Change on syntaxis?

2001-06-29 Thread Paul DuBois

At 9:05 AM +0100 6/22/01, Russ Michell wrote:
   Is this a new use of the function mysql_num_rows?
No!.


It's not a change in syntax, but it is a change in PHP's behavior.
In PHP 4, mysql_num_rows() and mysql_num_fields() will issue error
messages if the argument is not a result set.  In PHP 3 they didn't
seem to do this.  This may account for the new error messages after
updating PHP.


You can use the @ to 'suppress error messages' that may reveal
delicate information to users such as paths to directories on your
server. It can be preppended to almost any php function likely to
result in an error, if used incorrectly.

Russ

On Thu, 21 Jun 2001 23:30:03 +0200 Tom=?ISO-8859-1?B?4XMgR2FyY+0=?=a
Ferrari [EMAIL PROTECTED] wrote:

  Hello,

  I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors
  on lines like this:

  $rows = mysql_num_rows($result);

  and noticed that this is a solution:

  $rows = @mysql_num_rows($result);

  Is this a new use of the function mysql_num_rows?

  +-- --+
 Tom·s GarcÌa FerrariBigital
 http://bigital.com/ +--
  --+



  --
  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]


#---#

   Believe nothing - consider everything

   Russ Michell
   Anglia Polytechnic University Webteam

   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
   t: +44 (0)1223 363271 x 2331

   www.theruss.com

#---#


--
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]


--
Paul DuBois, [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: Change on syntaxis?

2001-06-22 Thread Christopher Ostmo

Tomás García Ferrari pressed the little lettered thingies in this order...

 Hello,
 
 I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors on
 lines like this:
 
 $rows = mysql_num_rows($result);
 
 and noticed that this is a solution:
 
 $rows = @mysql_num_rows($result);
 
 Is this a new use of the function mysql_num_rows?
 

The only thing that the @ does is to supress errors.
http://www.php.net/manual/en/language.operators.errorcontrol.php

What's your code and the error(s) you're getting? mysql_num_rows still 
has identical syntax as it did in PHP3.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

-- 
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: Change on syntaxis?

2001-06-22 Thread Paul Burney

on 6/21/01 2:30 PM, Tomás García Ferrari at [EMAIL PROTECTED] wrote:

 I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors on
 lines like this:
 
   $rows = mysql_num_rows($result);
 
 and noticed that this is a solution:
 
   $rows = @mysql_num_rows($result);
 
 Is this a new use of the function mysql_num_rows?

What are the error messages you get?  The @ symbol suppresses warning
messages being sent to the browser so it isn't fixing whatever the real
problem is.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster  Open Source Developer
UCLA - GSEIS - ETU
(310) 825-8365
[EMAIL PROTECTED]
http://www.gseis.ucla.edu/
++



--
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: Change on syntaxis?

2001-06-22 Thread David Balatero

$rows = mysql_num_rows($result) should work. If you want to know what's
going on, try doing:

?php
$rows = mysql_num_rows($result) or die(Error grabbing number of rows. MySQL
said:pfont color=red . mysql_error() . /font);
?

-- David Balatero

-Original Message-
From: Tomás García Ferrari [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 2:30 PM
To: PHP List
Subject: [PHP-DB] MySQL connection: Change on syntaxis?


Hello,

I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors on
lines like this:

$rows = mysql_num_rows($result);

and noticed that this is a solution:

$rows = @mysql_num_rows($result);

Is this a new use of the function mysql_num_rows?

+-- --+
   Tomás García Ferrari
   Bigital
   http://bigital.com/
+-- --+



--
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: Change on syntaxis?

2001-06-22 Thread Dobromir Velev

Hi,
the '@' is an error control operator avaialble in all php versions. When
prepended to an expression in PHP, any error messages that might be
generated by that expression will be ignored.
Check the PHP Manual for more info.

Dobromir Velev

-Original Message-
From: Tomás García Ferrari [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Date: Friday, June 22, 2001 7:33 AM
Subject: [PHP-DB] MySQL connection: Change on syntaxis?


Hello,

I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors on
lines like this:

$rows = mysql_num_rows($result);

and noticed that this is a solution:

$rows = @mysql_num_rows($result);

Is this a new use of the function mysql_num_rows?

+-- --+
   Tomás García Ferrari
   Bigital
   http://bigital.com/
+-- --+



--
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: Change on syntaxis?

2001-06-22 Thread Russ Michell

 Is this a new use of the function mysql_num_rows?
No!

You can use the @ to 'suppress error messages' that may reveal 
delicate information to users such as paths to directories on your 
server. It can be preppended to almost any php function likely to 
result in an error, if used incorrectly.

Russ

On Thu, 21 Jun 2001 23:30:03 +0200 Tom=?ISO-8859-1?B?4XMgR2FyY+0=?=a 
Ferrari [EMAIL PROTECTED] wrote:

 Hello,
 
 I updated php to version 4.0.5 and MySQL to version 2.32.39, had errors 
 on lines like this:
 
 $rows = mysql_num_rows($result);
 
 and noticed that this is a solution:
 
 $rows = @mysql_num_rows($result);
 
 Is this a new use of the function mysql_num_rows?
 
 +-- --+
Tomás García FerrariBigital
http://bigital.com/ +-- 
 --+
 
 
 
 -- 
 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]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.com

#---#


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

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]




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]




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 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]