Re: [PHP-DB] Problem connecting to db on Linux

2002-02-18 Thread David Sullivan

Hey,

I didn't have to do any special configuring. All I did was setup the root 
password, login via the mysql console client and create my databases, then 
use mysql_connect() and mysql_select_db() like you said. What have you done 
other than just installing it?

--
- Dave

On February 18, 2002 04:27 am, you wrote:
 Hi all,

 I've been working with PHP/MySQL on Win NT and Win 2000 for a few weeks.
 I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have
 moved my files across.

 I use an include file which logs on to the MySQL server and then connects
 to the database. It performs the login ok but not the select db part.

 I tried creating a db using a php script and then selecting it and got the
 same problem.

 I'm new on Linux so it might be something in the configuration which needs
 working on.

 Any suggestions?

 George in Edinburgh

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




Re: [PHP-DB] Problem connecting to db on Linux

2002-02-18 Thread Greg Donald

 I've been working with PHP/MySQL on Win NT and Win 2000 for a few weeks.
 I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have
moved
 my files across.

 I use an include file which logs on to the MySQL server and then connects
to
 the database. It performs the login ok but not the select db part.

 I tried creating a db using a php script and then selecting it and got the
 same problem.

 I'm new on Linux so it might be something in the configuration which needs
 working on.

 Any suggestions?

Well, if you had posted some code, someone might have seen the error...  :(

Anyway, here is how i do it:

if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
mysql_select_db($dbname, $db);
} else {
echo mysql_error();
exit;
}


Greg Donald - http://destiney.com/
http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/



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




Re: [PHP-DB] Problem connecting to db on Linux

2002-02-18 Thread George Pitcher

Greg, et al,

This is the contents of the include file:

?php

$link = mysql_connect ('localhost', 'root', '*') or die (Could not
select db);

mysql_select_db ('Heronsql') or die (Could not connect);

?

I have also tried it with the following:

?php

$link = mysql_connect ('localhost', 'root', '*');

echo mysql_errno().: .mysql_error().BR;

mysql_select_db ('Heronsql');

echo mysql_errno().: .mysql_error().BR;

?

Te results for this were:
0:0
0:0

I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about to
retest so I'll report back soon.

George
- Original Message -
From: Greg Donald [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 2:08 PM
Subject: Re: [PHP-DB] Problem connecting to db on Linux


  I've been working with PHP/MySQL on Win NT and Win 2000 for a few weeks.
  I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have
 moved
  my files across.
 
  I use an include file which logs on to the MySQL server and then
connects
 to
  the database. It performs the login ok but not the select db part.
 
  I tried creating a db using a php script and then selecting it and got
the
  same problem.
 
  I'm new on Linux so it might be something in the configuration which
needs
  working on.
 
  Any suggestions?

 Well, if you had posted some code, someone might have seen the error...
:(

 Anyway, here is how i do it:

 if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
 mysql_select_db($dbname, $db);
 } else {
 echo mysql_error();
 exit;
 }

 
 Greg Donald - http://destiney.com/
 http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
 


 --
 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] Problem connecting to db on Linux

2002-02-18 Thread Rick Emery

Have you spelled the name of the database correctly, including case
sensitivity?

What error message are you getting to indicate failure?

-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 8:21 AM
To: Greg Donald; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Problem connecting to db on Linux


Greg, et al,

This is the contents of the include file:

?php

$link = mysql_connect ('localhost', 'root', '*') or die (Could not
select db);

mysql_select_db ('Heronsql') or die (Could not connect);

?

I have also tried it with the following:

?php

$link = mysql_connect ('localhost', 'root', '*');

echo mysql_errno().: .mysql_error().BR;

mysql_select_db ('Heronsql');

echo mysql_errno().: .mysql_error().BR;

?

Te results for this were:
0:0
0:0

I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about to
retest so I'll report back soon.

George
- Original Message -
From: Greg Donald [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 2:08 PM
Subject: Re: [PHP-DB] Problem connecting to db on Linux


  I've been working with PHP/MySQL on Win NT and Win 2000 for a few weeks.
  I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have
 moved
  my files across.
 
  I use an include file which logs on to the MySQL server and then
connects
 to
  the database. It performs the login ok but not the select db part.
 
  I tried creating a db using a php script and then selecting it and got
the
  same problem.
 
  I'm new on Linux so it might be something in the configuration which
needs
  working on.
 
  Any suggestions?

 Well, if you had posted some code, someone might have seen the error...
:(

 Anyway, here is how i do it:

 if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
 mysql_select_db($dbname, $db);
 } else {
 echo mysql_error();
 exit;
 }

 
 Greg Donald - http://destiney.com/
 http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
 


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

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




Re: [PHP-DB] Problem connecting to db on Linux

2002-02-18 Thread George Pitcher

Rick,

I snipped the code from my windoze system. I did have to change the case of
the dbname to reflect the Linux version (all lc).

The error message I got (not displayed on screen but visible on 'view
source') was 'Could not connect' which, to me means that it got past the
login to server and stalled on the select db part?

George
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; Greg Donald
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 2:31 PM
Subject: RE: [PHP-DB] Problem connecting to db on Linux


 Have you spelled the name of the database correctly, including case
 sensitivity?

 What error message are you getting to indicate failure?

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 8:21 AM
 To: Greg Donald; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


 Greg, et al,

 This is the contents of the include file:

 ?php

 $link = mysql_connect ('localhost', 'root', '*') or die (Could not
 select db);

 mysql_select_db ('Heronsql') or die (Could not connect);

 ?

 I have also tried it with the following:

 ?php

 $link = mysql_connect ('localhost', 'root', '*');

 echo mysql_errno().: .mysql_error().BR;

 mysql_select_db ('Heronsql');

 echo mysql_errno().: .mysql_error().BR;

 ?

 Te results for this were:
 0:0
 0:0

 I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about to
 retest so I'll report back soon.

 George
 - Original Message -
 From: Greg Donald [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 18, 2002 2:08 PM
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


   I've been working with PHP/MySQL on Win NT and Win 2000 for a few
weeks.
   I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have
  moved
   my files across.
  
   I use an include file which logs on to the MySQL server and then
 connects
  to
   the database. It performs the login ok but not the select db part.
  
   I tried creating a db using a php script and then selecting it and got
 the
   same problem.
  
   I'm new on Linux so it might be something in the configuration which
 needs
   working on.
  
   Any suggestions?
 
  Well, if you had posted some code, someone might have seen the error...
 :(
 
  Anyway, here is how i do it:
 
  if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
  mysql_select_db($dbname, $db);
  } else {
  echo mysql_error();
  exit;
  }
 
  
  Greg Donald - http://destiney.com/
  http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
  
 
 
  --
  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

 --
 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] Problem connecting to db on Linux

2002-02-18 Thread Rick Emery

Do you have your error messages crossed?  I ask, because I would think your
cannot select message would go with your mysql_select_db() and your
cannot connect would go with your mysql_connect()

-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 8:48 AM
To: Rick Emery; Greg Donald; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Problem connecting to db on Linux


Rick,

I snipped the code from my windoze system. I did have to change the case of
the dbname to reflect the Linux version (all lc).

The error message I got (not displayed on screen but visible on 'view
source') was 'Could not connect' which, to me means that it got past the
login to server and stalled on the select db part?

George
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; Greg Donald
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 2:31 PM
Subject: RE: [PHP-DB] Problem connecting to db on Linux


 Have you spelled the name of the database correctly, including case
 sensitivity?

 What error message are you getting to indicate failure?

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 8:21 AM
 To: Greg Donald; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


 Greg, et al,

 This is the contents of the include file:

 ?php

 $link = mysql_connect ('localhost', 'root', '*') or die (Could not
 select db);

 mysql_select_db ('Heronsql') or die (Could not connect);

 ?

 I have also tried it with the following:

 ?php

 $link = mysql_connect ('localhost', 'root', '*');

 echo mysql_errno().: .mysql_error().BR;

 mysql_select_db ('Heronsql');

 echo mysql_errno().: .mysql_error().BR;

 ?

 Te results for this were:
 0:0
 0:0

 I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about to
 retest so I'll report back soon.

 George
 - Original Message -
 From: Greg Donald [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 18, 2002 2:08 PM
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


   I've been working with PHP/MySQL on Win NT and Win 2000 for a few
weeks.
   I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and have
  moved
   my files across.
  
   I use an include file which logs on to the MySQL server and then
 connects
  to
   the database. It performs the login ok but not the select db part.
  
   I tried creating a db using a php script and then selecting it and got
 the
   same problem.
  
   I'm new on Linux so it might be something in the configuration which
 needs
   working on.
  
   Any suggestions?
 
  Well, if you had posted some code, someone might have seen the error...
 :(
 
  Anyway, here is how i do it:
 
  if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
  mysql_select_db($dbname, $db);
  } else {
  echo mysql_error();
  exit;
  }
 
  
  Greg Donald - http://destiney.com/
  http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
  
 
 
  --
  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

 --
 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] Problem connecting to db on Linux

2002-02-18 Thread George Pitcher

Greg, et al,

Now the re-installation is complete, I am getting past the original error --
only to hit another.

My query is as follows (echoed to web page):

SELECT DISTINCT Nickname, HEI_ID FROM customers WHERE Nickname  '' ORDER
BY Nickname

I have checked case against db an it is correct. Am I missing something else
which is obvious?

George

- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; Rick Emery [EMAIL PROTECTED];
Greg Donald [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 3:19 PM
Subject: RE: [PHP-DB] Problem connecting to db on Linux


 Do you have your error messages crossed?  I ask, because I would think
your
 cannot select message would go with your mysql_select_db() and your
 cannot connect would go with your mysql_connect()

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 8:48 AM
 To: Rick Emery; Greg Donald; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


 Rick,

 I snipped the code from my windoze system. I did have to change the case
of
 the dbname to reflect the Linux version (all lc).

 The error message I got (not displayed on screen but visible on 'view
 source') was 'Could not connect' which, to me means that it got past the
 login to server and stalled on the select db part?

 George
 - Original Message -
 From: Rick Emery [EMAIL PROTECTED]
 To: 'George Pitcher' [EMAIL PROTECTED]; Greg Donald
 [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 18, 2002 2:31 PM
 Subject: RE: [PHP-DB] Problem connecting to db on Linux


  Have you spelled the name of the database correctly, including case
  sensitivity?
 
  What error message are you getting to indicate failure?
 
  -Original Message-
  From: George Pitcher [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 18, 2002 8:21 AM
  To: Greg Donald; [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Problem connecting to db on Linux
 
 
  Greg, et al,
 
  This is the contents of the include file:
 
  ?php
 
  $link = mysql_connect ('localhost', 'root', '*') or die (Could not
  select db);
 
  mysql_select_db ('Heronsql') or die (Could not connect);
 
  ?
 
  I have also tried it with the following:
 
  ?php
 
  $link = mysql_connect ('localhost', 'root', '*');
 
  echo mysql_errno().: .mysql_error().BR;
 
  mysql_select_db ('Heronsql');
 
  echo mysql_errno().: .mysql_error().BR;
 
  ?
 
  Te results for this were:
  0:0
  0:0
 
  I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about to
  retest so I'll report back soon.
 
  George
  - Original Message -
  From: Greg Donald [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, February 18, 2002 2:08 PM
  Subject: Re: [PHP-DB] Problem connecting to db on Linux
 
 
I've been working with PHP/MySQL on Win NT and Win 2000 for a few
 weeks.
I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and
have
   moved
my files across.
   
I use an include file which logs on to the MySQL server and then
  connects
   to
the database. It performs the login ok but not the select db part.
   
I tried creating a db using a php script and then selecting it and
got
  the
same problem.
   
I'm new on Linux so it might be something in the configuration which
  needs
working on.
   
Any suggestions?
  
   Well, if you had posted some code, someone might have seen the
error...
  :(
  
   Anyway, here is how i do it:
  
   if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
   mysql_select_db($dbname, $db);
   } else {
   echo mysql_error();
   exit;
   }
  
 
 
   Greg Donald - http://destiney.com/
   http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
 
 
  
  
   --
   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
 
  --
  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


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




RE: [PHP-DB] Problem connecting to db on Linux

2002-02-18 Thread Rick Emery

what is the error message you get?
do you print otu mysql_error() ?

-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 9:42 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Problem connecting to db on Linux


Greg, et al,

Now the re-installation is complete, I am getting past the original error --
only to hit another.

My query is as follows (echoed to web page):

SELECT DISTINCT Nickname, HEI_ID FROM customers WHERE Nickname  '' ORDER
BY Nickname

I have checked case against db an it is correct. Am I missing something else
which is obvious?

George

- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; Rick Emery [EMAIL PROTECTED];
Greg Donald [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 3:19 PM
Subject: RE: [PHP-DB] Problem connecting to db on Linux


 Do you have your error messages crossed?  I ask, because I would think
your
 cannot select message would go with your mysql_select_db() and your
 cannot connect would go with your mysql_connect()

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 8:48 AM
 To: Rick Emery; Greg Donald; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


 Rick,

 I snipped the code from my windoze system. I did have to change the case
of
 the dbname to reflect the Linux version (all lc).

 The error message I got (not displayed on screen but visible on 'view
 source') was 'Could not connect' which, to me means that it got past the
 login to server and stalled on the select db part?

 George
 - Original Message -
 From: Rick Emery [EMAIL PROTECTED]
 To: 'George Pitcher' [EMAIL PROTECTED]; Greg Donald
 [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 18, 2002 2:31 PM
 Subject: RE: [PHP-DB] Problem connecting to db on Linux


  Have you spelled the name of the database correctly, including case
  sensitivity?
 
  What error message are you getting to indicate failure?
 
  -Original Message-
  From: George Pitcher [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 18, 2002 8:21 AM
  To: Greg Donald; [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Problem connecting to db on Linux
 
 
  Greg, et al,
 
  This is the contents of the include file:
 
  ?php
 
  $link = mysql_connect ('localhost', 'root', '*') or die (Could not
  select db);
 
  mysql_select_db ('Heronsql') or die (Could not connect);
 
  ?
 
  I have also tried it with the following:
 
  ?php
 
  $link = mysql_connect ('localhost', 'root', '*');
 
  echo mysql_errno().: .mysql_error().BR;
 
  mysql_select_db ('Heronsql');
 
  echo mysql_errno().: .mysql_error().BR;
 
  ?
 
  Te results for this were:
  0:0
  0:0
 
  I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about to
  retest so I'll report back soon.
 
  George
  - Original Message -
  From: Greg Donald [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, February 18, 2002 2:08 PM
  Subject: Re: [PHP-DB] Problem connecting to db on Linux
 
 
I've been working with PHP/MySQL on Win NT and Win 2000 for a few
 weeks.
I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and
have
   moved
my files across.
   
I use an include file which logs on to the MySQL server and then
  connects
   to
the database. It performs the login ok but not the select db part.
   
I tried creating a db using a php script and then selecting it and
got
  the
same problem.
   
I'm new on Linux so it might be something in the configuration which
  needs
working on.
   
Any suggestions?
  
   Well, if you had posted some code, someone might have seen the
error...
  :(
  
   Anyway, here is how i do it:
  
   if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
   mysql_select_db($dbname, $db);
   } else {
   echo mysql_error();
   exit;
   }
  
 
 
   Greg Donald - http://destiney.com/
   http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
 
 
  
  
   --
   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
 
  --
  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


-- 
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] Problem connecting to db on Linux

2002-02-18 Thread George Pitcher

Rick,

Sorry, here it is:
Warning: Supplied argument is not a valid MySQL result resource in
/var/www/html/HERONweb/home.php on line 32

I have 'echo mysql_errno();' just after the query is called but no number is
being displayed.

George
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 3:46 PM
Subject: RE: [PHP-DB] Problem connecting to db on Linux


 what is the error message you get?
 do you print otu mysql_error() ?

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 9:42 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


 Greg, et al,

 Now the re-installation is complete, I am getting past the original
error --
 only to hit another.

 My query is as follows (echoed to web page):

 SELECT DISTINCT Nickname, HEI_ID FROM customers WHERE Nickname  '' ORDER
 BY Nickname

 I have checked case against db an it is correct. Am I missing something
else
 which is obvious?

 George

 - Original Message -
 From: Rick Emery [EMAIL PROTECTED]
 To: 'George Pitcher' [EMAIL PROTECTED]; Rick Emery
[EMAIL PROTECTED];
 Greg Donald [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 18, 2002 3:19 PM
 Subject: RE: [PHP-DB] Problem connecting to db on Linux


  Do you have your error messages crossed?  I ask, because I would think
 your
  cannot select message would go with your mysql_select_db() and your
  cannot connect would go with your mysql_connect()
 
  -Original Message-
  From: George Pitcher [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 18, 2002 8:48 AM
  To: Rick Emery; Greg Donald; [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Problem connecting to db on Linux
 
 
  Rick,
 
  I snipped the code from my windoze system. I did have to change the case
 of
  the dbname to reflect the Linux version (all lc).
 
  The error message I got (not displayed on screen but visible on 'view
  source') was 'Could not connect' which, to me means that it got past the
  login to server and stalled on the select db part?
 
  George
  - Original Message -
  From: Rick Emery [EMAIL PROTECTED]
  To: 'George Pitcher' [EMAIL PROTECTED]; Greg Donald
  [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, February 18, 2002 2:31 PM
  Subject: RE: [PHP-DB] Problem connecting to db on Linux
 
 
   Have you spelled the name of the database correctly, including case
   sensitivity?
  
   What error message are you getting to indicate failure?
  
   -Original Message-
   From: George Pitcher [mailto:[EMAIL PROTECTED]]
   Sent: Monday, February 18, 2002 8:21 AM
   To: Greg Donald; [EMAIL PROTECTED]
   Subject: Re: [PHP-DB] Problem connecting to db on Linux
  
  
   Greg, et al,
  
   This is the contents of the include file:
  
   ?php
  
   $link = mysql_connect ('localhost', 'root', '*') or die (Could
not
   select db);
  
   mysql_select_db ('Heronsql') or die (Could not connect);
  
   ?
  
   I have also tried it with the following:
  
   ?php
  
   $link = mysql_connect ('localhost', 'root', '*');
  
   echo mysql_errno().: .mysql_error().BR;
  
   mysql_select_db ('Heronsql');
  
   echo mysql_errno().: .mysql_error().BR;
  
   ?
  
   Te results for this were:
   0:0
   0:0
  
   I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about
to
   retest so I'll report back soon.
  
   George
   - Original Message -
   From: Greg Donald [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, February 18, 2002 2:08 PM
   Subject: Re: [PHP-DB] Problem connecting to db on Linux
  
  
 I've been working with PHP/MySQL on Win NT and Win 2000 for a few
  weeks.
 I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and
 have
moved
 my files across.

 I use an include file which logs on to the MySQL server and then
   connects
to
 the database. It performs the login ok but not the select db part.

 I tried creating a db using a php script and then selecting it and
 got
   the
 same problem.

 I'm new on Linux so it might be something in the configuration
which
   needs
 working on.

 Any suggestions?
   
Well, if you had posted some code, someone might have seen the
 error...
   :(
   
Anyway, here is how i do it:
   
if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
mysql_select_db($dbname, $db);
} else {
echo mysql_error();
exit;
}
   
  
  
Greg Donald - http://destiney.com/
http://phprated.com/ | http://phplinks.org/ |
http://phptopsites.com/
  
  
   
   
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
  
  
   --
   PHP Database Mailing List (http

RE: [PHP-DB] Problem connecting to db on Linux

2002-02-18 Thread Rick Emery

so, you probably have something like, right?  If not, change your code to:

$query = SELECT DISTINCT Nickname, HEI_ID FROM customers WHERE Nickname 
ORDER BY Nickname;
$result = mysql_query($query) or die(error: .mysql_error());

show us your code.

I ask, because you appear to have an extra  in fron of ORDER BY

-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 9:53 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Problem connecting to db on Linux


Rick,

Sorry, here it is:
Warning: Supplied argument is not a valid MySQL result resource in
/var/www/html/HERONweb/home.php on line 32

I have 'echo mysql_errno();' just after the query is called but no number is
being displayed.

George
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'George Pitcher' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, February 18, 2002 3:46 PM
Subject: RE: [PHP-DB] Problem connecting to db on Linux


 what is the error message you get?
 do you print otu mysql_error() ?

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 18, 2002 9:42 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Problem connecting to db on Linux


 Greg, et al,

 Now the re-installation is complete, I am getting past the original
error --
 only to hit another.

 My query is as follows (echoed to web page):

 SELECT DISTINCT Nickname, HEI_ID FROM customers WHERE Nickname  '' ORDER
 BY Nickname

 I have checked case against db an it is correct. Am I missing something
else
 which is obvious?

 George

 - Original Message -
 From: Rick Emery [EMAIL PROTECTED]
 To: 'George Pitcher' [EMAIL PROTECTED]; Rick Emery
[EMAIL PROTECTED];
 Greg Donald [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, February 18, 2002 3:19 PM
 Subject: RE: [PHP-DB] Problem connecting to db on Linux


  Do you have your error messages crossed?  I ask, because I would think
 your
  cannot select message would go with your mysql_select_db() and your
  cannot connect would go with your mysql_connect()
 
  -Original Message-
  From: George Pitcher [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 18, 2002 8:48 AM
  To: Rick Emery; Greg Donald; [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] Problem connecting to db on Linux
 
 
  Rick,
 
  I snipped the code from my windoze system. I did have to change the case
 of
  the dbname to reflect the Linux version (all lc).
 
  The error message I got (not displayed on screen but visible on 'view
  source') was 'Could not connect' which, to me means that it got past the
  login to server and stalled on the select db part?
 
  George
  - Original Message -
  From: Rick Emery [EMAIL PROTECTED]
  To: 'George Pitcher' [EMAIL PROTECTED]; Greg Donald
  [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, February 18, 2002 2:31 PM
  Subject: RE: [PHP-DB] Problem connecting to db on Linux
 
 
   Have you spelled the name of the database correctly, including case
   sensitivity?
  
   What error message are you getting to indicate failure?
  
   -Original Message-
   From: George Pitcher [mailto:[EMAIL PROTECTED]]
   Sent: Monday, February 18, 2002 8:21 AM
   To: Greg Donald; [EMAIL PROTECTED]
   Subject: Re: [PHP-DB] Problem connecting to db on Linux
  
  
   Greg, et al,
  
   This is the contents of the include file:
  
   ?php
  
   $link = mysql_connect ('localhost', 'root', '*') or die (Could
not
   select db);
  
   mysql_select_db ('Heronsql') or die (Could not connect);
  
   ?
  
   I have also tried it with the following:
  
   ?php
  
   $link = mysql_connect ('localhost', 'root', '*');
  
   echo mysql_errno().: .mysql_error().BR;
  
   mysql_select_db ('Heronsql');
  
   echo mysql_errno().: .mysql_error().BR;
  
   ?
  
   Te results for this were:
   0:0
   0:0
  
   I have reinstalled my Mandrake (MySQL/PHP4.0.6/Apache) and I am about
to
   retest so I'll report back soon.
  
   George
   - Original Message -
   From: Greg Donald [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, February 18, 2002 2:08 PM
   Subject: Re: [PHP-DB] Problem connecting to db on Linux
  
  
 I've been working with PHP/MySQL on Win NT and Win 2000 for a few
  weeks.
 I've now set up a Linux machine (Mandrake 8.1 on Dell laptop) and
 have
moved
 my files across.

 I use an include file which logs on to the MySQL server and then
   connects
to
 the database. It performs the login ok but not the select db part.

 I tried creating a db using a php script and then selecting it and
 got
   the
 same problem.

 I'm new on Linux so it might be something in the configuration
which
   needs
 working on.

 Any suggestions?
   
Well, if you had posted some code, someone might have seen the
 error...
   :(
   
Anyway, here is how i do it:
   
if($db = mysql_pconnect($dbhost, $dbuser, $dbpasswd)){
mysql_select_db($dbname