[PHP-DB] What's wrong?

2001-11-20 Thread Sergio Augusto Bitencourt Petrovcic

Ho there...I really wonder what's wrong with this script. The error is in
this line below:
if((count($info) != 1)  ($folder == $info[2])) echo tabletrtda
href= . $info[1] .  . $info[0] . /abr/td/tr/table;
The condition ($folder == $info[2]) is not working!
I hope you can help me!
Here's the code:

?php

$link_name = Tudo sobre automação;
$link_address = http://www.automacao.eng.br;;
$link_folder = faculdade;
$file = teste.txt;

function write($file,$link_name,$link_address,$link_folder) {
 $file=fopen($file,w);
 fwrite($file,$link_name|$link_address|$link_folder\n);
 fclose($file);
}

function read($file,$folder) {
 $file=fopen($file,r);
 while (!feof ($file)) {
  $buffer = fgets($file,1024);
  $info = explode(|,$buffer);
  if((count($info) != 1)  ($folder == $info[2])) echo tabletrtda
href= . $info[1] .  . $info[0] . /abr/td/tr/table;
 }
 fclose($file);
}

write($file,$link_name,$link_address,$link_folder);
read($file,faculdade);

?

Thanks!


-- 
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] What's wrong?

2001-11-20 Thread Dobromir Velev

Hi,
the most probable reason is that the file you're reading from was saved in a
different filesystem and the $info[2] has some newline characters at the
end.

You can use the trim() function to remove it. Than your expression will look
something like this
if(count($info) != 1  $folder == trim($info[2]))

HTH
Dobromir Velev

-Original Message-
From: Sergio Augusto Bitencourt Petrovcic [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, November 20, 2001 13:58
Subject: [PHP-DB] What's wrong?


Ho there...I really wonder what's wrong with this script. The error is in
this line below:
if((count($info) != 1)  ($folder == $info[2])) echo tabletrtda
href= . $info[1] .  . $info[0] . /abr/td/tr/table;
The condition ($folder == $info[2]) is not working!
I hope you can help me!
Here's the code:

?php

$link_name = Tudo sobre automação;
$link_address = http://www.automacao.eng.br;;
$link_folder = faculdade;
$file = teste.txt;

function write($file,$link_name,$link_address,$link_folder) {
 $file=fopen($file,w);
 fwrite($file,$link_name|$link_address|$link_folder\n);
 fclose($file);
}

function read($file,$folder) {
 $file=fopen($file,r);
 while (!feof ($file)) {
  $buffer = fgets($file,1024);
  $info = explode(|,$buffer);
  if((count($info) != 1)  ($folder == $info[2])) echo tabletrtda
href= . $info[1] .  . $info[0] . /abr/td/tr/table;
 }
 fclose($file);
}

write($file,$link_name,$link_address,$link_folder);
read($file,faculdade);

?

Thanks!


--
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] consult different databases on different machines

2001-11-20 Thread Miguel Loureiro

Hello all,
I'm working with 2 different systems ( php/mysql in Winnt and php/mysql
in linux machine), and I would like from WinNt machine consult
information in linux machine !!!
When I make connection i got no problem(since in linux machine had
created an user to acess a database like username@% ...), but when I
made a simple select I got an error message :impossible to execute
select .
My question is , is it really impossible to do that (from winnt access
linux/mysql database )???
I think not, because if it was impossible I never access
database,wright???
Any ideas about that would help.
Thanhs for your time



--
Best Regards
Miguel Joaquim Rodrigues Loureiro




-- 
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] consult different databases on different machines

2001-11-20 Thread Russ Michell

Miguel:

1). Are you trying to connect an MS Access database to a MySQL database?
2). Are the databases and servers both/individually remote or local?

See if: http://gertrude.anglia.ac.uk/webteam/tips/php_sql/odbc.htm helps you any.

Good luck.
Russ

On Tue, 20 Nov 2001 12:35:29 + Miguel Loureiro [EMAIL PROTECTED] wrote:

 Hello all,
 I'm working with 2 different systems ( php/mysql in Winnt and php/mysql
 in linux machine), and I would like from WinNt machine consult
 information in linux machine !!!
 When I make connection i got no problem(since in linux machine had
 created an user to acess a database like username@% ...), but when I
 made a simple select I got an error message :impossible to execute
 select .
 My question is , is it really impossible to do that (from winnt access
 linux/mysql database )???
 I think not, because if it was impossible I never access
 database,wright???
 Any ideas about that would help.
 Thanhs for your time
 
 
 
 --
 Best Regards
 Miguel Joaquim Rodrigues Loureiro
 
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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]




[PHP-DB] Fw: Your Info Has Arrived

2001-11-20 Thread usa

To: [EMAIL PROTECTED]
From:  ()
Subject: Fw: Your Info Has Arrived

Below is the result of your feedback form.  It was submitted by
 () on Tuesday, November 20, 2001 at 08:20:21
---

message: 
Real Networker Leads, Real Powerful Cash
 
We Have A True Lead System And We Will Make You Money!

email us at [EMAIL PROTECTED]
Include Your Name Email And PHONE NUMBER [INCLUDE YOUR PHONE OR WE 
WILL NOT GET BACK TO YOU]



**
To Be Removed From Our List Email [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] consult different databases on different machines

2001-11-20 Thread Rick Emery

1.  He's not trying to connect MS Access to mySQL.  He's trying TO ACCESS a
mySQL database on a Win-NT machine.

2.  Both mySQL servers are remote.

-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 6:39 AM
To: Miguel Loureiro
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] consult different databases on different machines


Miguel:

1). Are you trying to connect an MS Access database to a MySQL database?
2). Are the databases and servers both/individually remote or local?

See if: http://gertrude.anglia.ac.uk/webteam/tips/php_sql/odbc.htm helps you
any.

Good luck.
Russ

On Tue, 20 Nov 2001 12:35:29 + Miguel Loureiro
[EMAIL PROTECTED] wrote:

 Hello all,
 I'm working with 2 different systems ( php/mysql in Winnt and php/mysql
 in linux machine), and I would like from WinNt machine consult
 information in linux machine !!!
 When I make connection i got no problem(since in linux machine had
 created an user to acess a database like username@% ...), but when I
 made a simple select I got an error message :impossible to execute
 select .
 My question is , is it really impossible to do that (from winnt access
 linux/mysql database )???
 I think not, because if it was impossible I never access
 database,wright???
 Any ideas about that would help.
 Thanhs for your time
 
 
 
 --
 Best Regards
 Miguel Joaquim Rodrigues Loureiro
 
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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]


-- 
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: RE: [PHP-DB] consult different databases on different machines

2001-11-20 Thread Russ Michell

In which case you're best off helping him as I have no idea!

Russ
On Tue, 20 Nov 2001 08:10:02 -0600 Rick Emery [EMAIL PROTECTED] wrote:

 1.  He's not trying to connect MS Access to mySQL.  He's trying TO ACCESS a
 mySQL database on a Win-NT machine.
 
 2.  Both mySQL servers are remote.
 
 -Original Message-
 From: Russ Michell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 20, 2001 6:39 AM
 To: Miguel Loureiro
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] consult different databases on different machines
 
 
 Miguel:
 
 1). Are you trying to connect an MS Access database to a MySQL database?
 2). Are the databases and servers both/individually remote or local?
 
 See if: http://gertrude.anglia.ac.uk/webteam/tips/php_sql/odbc.htm helps you
 any.
 
 Good luck.
 Russ
 
 On Tue, 20 Nov 2001 12:35:29 + Miguel Loureiro
 [EMAIL PROTECTED] wrote:
 
  Hello all,
  I'm working with 2 different systems ( php/mysql in Winnt and php/mysql
  in linux machine), and I would like from WinNt machine consult
  information in linux machine !!!
  When I make connection i got no problem(since in linux machine had
  created an user to acess a database like username@% ...), but when I
  made a simple select I got an error message :impossible to execute
  select .
  My question is , is it really impossible to do that (from winnt access
  linux/mysql database )???
  I think not, because if it was impossible I never access
  database,wright???
  Any ideas about that would help.
  Thanhs for your time
  
  
  
  --
  Best Regards
  Miguel Joaquim Rodrigues Loureiro
  
  
 
 #---#
   
   Believe nothing - consider everything 
   
   Russ Michell
   Anglia Polytechnic University Webteam
   Room 1C 'The Eastings' East Road, Cambridge
   
   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
 
   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]
 
 
 -- 
 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
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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] consult different databases on different machines

2001-11-20 Thread Russ Michell

Right then:

* You have 2 remote MySQL DB's on different O/S's 
* You want one to 'talk' to the other one?

errr (whirrr grind..etc)

I'm sorry if you've already stated this in your first email, but could you not just 
query both DB's 
separatley using mysql_select_db() Using separate DB connections? I guess it depends 
on the type 
of query you want from both DB's...

I'm sorry but that''s about as far as I can go!
Good luck though.

Russ


On Tue, 20 Nov 2001 14:12:58 + Miguel Loureiro [EMAIL PROTECTED] wrote:

 Hello Russ:
 
 
 Russ Michell wrote:
 
  Miguel:
 
  1). Are you trying to connect an MS Access database to a MySQL database?
 
 No, they are both Mysql databases.
 
 
  2). Are the databases and servers both/individually remote or local?
 
 I have 2 database servers, in Winnt apache/php/mysql for win32 and in
 linux(suse)apache/php/mysql, so they are different ...
 
 Thanks for your time.
 --
 Best Regards
 Miguel Joaquim Rodrigues Loureiro
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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: RE: [PHP-DB] consult different databases on different machines

2001-11-20 Thread Russ Michell

Exactly what I just suggested - hey do we have telepathic abilities or what?? :-)

Russ

On Tue, 20 Nov 2001 08:21:24 -0600 Rick Emery [EMAIL PROTECTED] wrote:

 Hey Russ,
 
 I'm wondering.  Maybe this might work.  What do you think?:
 
 $server1 = mysql_connect(server_1,user1,password1);
 $server2 = mysql_connect(server_2,user2,password2);
 
 $db1 = mysql_select_db(database1,$server1);
 $db2 = mysql_select_db(database2,$server2);
 
 rick
 
 Richard Emery
 IT Sr. Project Manager
 (972) 478-3398
 
 
 
 -Original Message-
 From: Rick Emery 
 Sent: Tuesday, November 20, 2001 8:13 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: RE: [PHP-DB] consult different databases on different
 machines
 
 
 I got no clue either.  I'm hoping somebody can, though.
 
 rick
 
 Richard Emery
 IT Sr. Project Manager
 (972) 478-3398
 
 
 
 -Original Message-
 From: Russ Michell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 20, 2001 8:09 AM
 To: Rick Emery
 Cc: [EMAIL PROTECTED]
 Subject: Re: RE: [PHP-DB] consult different databases on different
 machines
 
 
 In which case you're best off helping him as I have no idea!
 
 Russ
 On Tue, 20 Nov 2001 08:10:02 -0600 Rick Emery [EMAIL PROTECTED] wrote:
 
  1.  He's not trying to connect MS Access to mySQL.  He's trying TO ACCESS
 a
  mySQL database on a Win-NT machine.
  
  2.  Both mySQL servers are remote.
  
  -Original Message-
  From: Russ Michell [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 20, 2001 6:39 AM
  To: Miguel Loureiro
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] consult different databases on different machines
  
  
  Miguel:
  
  1). Are you trying to connect an MS Access database to a MySQL database?
  2). Are the databases and servers both/individually remote or local?
  
  See if: http://gertrude.anglia.ac.uk/webteam/tips/php_sql/odbc.htm helps
 you
  any.
  
  Good luck.
  Russ
  
  On Tue, 20 Nov 2001 12:35:29 + Miguel Loureiro
  [EMAIL PROTECTED] wrote:
  
   Hello all,
   I'm working with 2 different systems ( php/mysql in Winnt and php/mysql
   in linux machine), and I would like from WinNt machine consult
   information in linux machine !!!
   When I make connection i got no problem(since in linux machine had
   created an user to acess a database like username@% ...), but when I
   made a simple select I got an error message :impossible to execute
   select .
   My question is , is it really impossible to do that (from winnt access
   linux/mysql database )???
   I think not, because if it was impossible I never access
   database,wright???
   Any ideas about that would help.
   Thanhs for your time
   
   
   
   --
   Best Regards
   Miguel Joaquim Rodrigues Loureiro
   
   
  
  #---#
  
Believe nothing - consider everything   

Russ Michell
Anglia Polytechnic University Webteam
Room 1C 'The Eastings' East Road, Cambridge

e: [EMAIL PROTECTED]
w: www.apu.ac.uk/webteam
  
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]
  
  
  -- 
  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
   Room 1C 'The Eastings' East Road, Cambridge
   
   e: [EMAIL PROTECTED]
   w: www.apu.ac.uk/webteam
 
   www.theruss.com
   
 #---#
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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]




[PHP-DB] Retrieve HTML from db

2001-11-20 Thread Joe Van Meer

Hi there...I have a db filled with various HTML code examples, tags, etc...
how would I format it so that it would appear like A href='index.php'Link
One/a. I was using the strip_tags() function and quickly found out that
this wasn't the best way to do it :)

Cheers, Joe:)



-- 
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] Retrieve HTML from db

2001-11-20 Thread Russ Michell

* You could cheat and wrap anchor tags around the DB content you want to display as a 
hyperlink
* If you know which variable from the DB you wish to be displayed as a link then:

$variable = a href=\yourpage.php\$variable/a;

HTH :-)
Russ

On Tue, 20 Nov 2001 11:54:25 -0400 Joe Van Meer [EMAIL PROTECTED] wrote:

 Hi there...I have a db filled with various HTML code examples, tags, etc...
 how would I format it so that it would appear like A href='index.php'Link
 One/a. I was using the strip_tags() function and quickly found out that
 this wasn't the best way to do it :)
 
 Cheers, Joe:)
 
 
 
 -- 
 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
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  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] Retrieve HTML from db

2001-11-20 Thread Richard S. Crawford

Try htmlentities() or htmlspecialchars(), which is what I use.

At 07:54 AM 11/20/2001, Joe Van Meer wrote:
Hi there...I have a db filled with various HTML code examples, tags, etc...
how would I format it so that it would appear like A href='index.php'Link
One/a. I was using the strip_tags() function and quickly found out that
this wasn't the best way to do it :)

Cheers, Joe:)



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


Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!


--
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] PHP and MS SQL 2000 Performance

2001-11-20 Thread rhelms

Am Mon, 19 Nov 2001 schrieb John Lim:
 Are you using ODBC? We recently had similar problems, and it turned out that
 we
 had SQL tracing enabled, and every single ODBC function call was being
 written
 to SQL.LOG

And added, such a traced logfile can grow up to some megabyte of data.

 I know that from an other db-connectiontool. Has someone made expearance with
using php-connections to a ms-sqlserver from a linux-box (odbc-connections from
linux)?

Regards,
Ruprecht

--
For germans


Vielleicht zufällig ein Projekt zu vergeben und nun auf der Suche nach einem 
Freelancer?
Dann doch gleichmal vorbeischauen unter http://www.gulp.de/profil/rhelms.html

--

--
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] Re: Retrieve HTML from db

2001-11-20 Thread Joe Van Meer

Thx guys for your suggestions. My question probably wasn't worded as good as
it could be. Here's the situation,

I have a small php app that I'm building to display, insert, edit, etc...
various types of code snipits (asp, php, html, etc...) in a db. I also have
a download option that creates a text file with the code that they've
selected.

I have 2 problems...the first is that when I go to view the text file I have
all sorts of BR tags within the text, this is due to the nl2br function I
used prior to the db insertion. How would I get rid of those?

The seond problem is when a user goes to view an html code example, say with
a hyperlink, the hyperlink is made active replacing the code with the actual
a href tag.

Sorry for not being clear with my first post.

Cheers, Joe



Joe Van Meer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there...I have a db filled with various HTML code examples, tags,
etc...
 how would I format it so that it would appear like A
href='index.php'Link
 One/a. I was using the strip_tags() function and quickly found out that
 this wasn't the best way to do it :)

 Cheers, Joe:)





-- 
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] PHP and MS SQL 2000 Performance

2001-11-20 Thread Andrew Hill

Ruprecht,

SQLServer from Linux is pretty straightfoward.
If you want full SQLServer2000 support, you will want to use ODBC.
There is a HOWTO at www.iodbc.org for linking PHP --with-iodbc.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 19, 2001 3:11 PM
 To: John Lim; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] PHP and MS SQL 2000 Performance


 Am Mon, 19 Nov 2001 schrieb John Lim:
  Are you using ODBC? We recently had similar problems, and it
 turned out that
  we
  had SQL tracing enabled, and every single ODBC function call was being
  written
  to SQL.LOG

 And added, such a traced logfile can grow up to some megabyte of data.

  I know that from an other db-connectiontool. Has someone made
 expearance with
 using php-connections to a ms-sqlserver from a linux-box
 (odbc-connections from
 linux)?

 Regards,
 Ruprecht

 --
 For germans


 Vielleicht zufällig ein Projekt zu vergeben und nun auf der Suche
 nach einem Freelancer?
 Dann doch gleichmal vorbeischauen unter
 http://www.gulp.de/profil/rhelms.html

 --

 --
 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] Common DB Abstraction Layer: Re: [PEAR-DEV] Adoption of Metabase

2001-11-20 Thread John Lim


Tomas V.V.Cox [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 On Tuesday 20 November 2001 07:41, Manuel Lemos wrote:

 Hi Manuel,

  I don't have the time or motivation to develop things for PEAR just
  because it is funny to cooperate. I am no longer a college student so
  I don't have plenty of free time to spare. What I do is because I
  need the things for my job. If I am not selling what I do, I don't
  have a problem with sharing. That is what I am doing with Metabase.

 That's the same here. At least me I'm here to develop stuff that I
 later use in my work, so indirectly you and me are making money with
 that as it helps our work to be more productive.

  One thing is certain, I don't want to go where I am not wanted. If
  there is no interest in integrating Metabase in PEAR, fine. If not, I
  don't have a problem with that. From the silence of PEAR core
  developers, I am afraid there isn't much hope from their side to
  cooperate.  At least I made an honest attempt to cooperate.

 It will be very nice to have a unique abstraction layer where all of us
 contribute to. But in my opinion to impose MetaBase isn't they way to
 go. PHPLib, ADODB, PEAR DB all are good developments with their
 community and their developers, and trying to drop all of them with
 Metabase is a crazy idea.

 The only exit I see of the multi abstraction layers problems is trying
 to join all those communities and start a new development from the
 ground. The code is almost all written so only need to glue it to meet
 the specs of the new resultant layer. Then each team could provide
 their own wrappers to make things easy to their users. That's IMO a
 cooperative behaviour.

 Tomas V.V.Cox

Hi Tomas, Manuel, everyone,

I think that different programmers have different needs.
Metabase's goal is 100% DB portability. PEAR DB builds on the
PEAR classes to give a solid set of classes. ADODB is aimed
at converting the heathen ASP'ers to the one true religion.
I also know of a PHP DBI class also from people who still need
the $perl~= /fix/;

Each designer has a different point of view, like Tomas has
written a really excellent oci8 select limit emulation, but looking
at the code, it's so complicated that i decided not to incorporate it
in ADODB because I value simplicity. I know Tomas' code works
in theory, and its really impressive that you even considered UNIONs,
Tomas, but I just like simple code that I can keep in my head.

I think some standardization in terms of API is good, but I don't
think most people care. Newcomers to programming will want to use
something easy and standard - is PEAR DB already the standard?
Windows programmers would want to use something familar. I already
have a prototype PEAR DB api wrapper for ADODB , and ADODB has
support for PEAR Error() also, but the people who like ADODB
generally are not that interested (at the moment).

 to join all those communities and start a new development from the
 ground. The code is almost all written so only need to glue it to meet
 the specs of the new resultant layer.

Actually the common code is already available: it is the
database extension API's. But most of the problems are
in the database extension APIs also, and our work is fixing
their mistakes.

Examples:
-Oracle ocifetchinto() returns OCI_ASSOC arrays in uppercase,
 when everyone else is using lowercase.

-Magic Quotes murders our quoting, and what about magic quotes
 sybase which happens to be for interbase and sql server too!

-Postgresql does not have an error number to return. And there is
 no pg_insert_id() either.

-Interbase's API is missing an arm and a leg, and whether it is
 the left or right arm missing is not documented anywhere.

-All extensions should support blobs like Oracle, with a fetch mode
 that makes SELECT blob FROM table transparent with no special
 coding.

If we fixed these problems and more, we could talk about having
a unified API. Otherwise for the Oracle OCI_ASSOC, I would prefer
not to change it for speed, Manuel would want to provide an emulation
layer, i would object because it's slow, etc...

 John

PS: the history of windows shows it's ok to have multiple abstraction
layers: ODBC, RDO, DAO, ADO, ADO+, JDBC, Delphi's db classes, VB's data
controls, provided there is progress.









-- 
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] php/mysql error

2001-11-20 Thread jon

please review my script

I have already had it said that the script is fine, please check.  IF 
it is then I have a set up proiblem which I would also like help to 
solve. BUT mysql outside of apache works fine. 

I started with an already set up apache so I don't know if mysql was 
installed in right, but the staements before the error seem to work so 
I would think so. 

I running my web server under red hat 7.0, I am new to apache/php and 
mysql. 

Thanks



I get an error when it hits the line
 
while ($row = mysql_fetch_row($rs)) {}
 
I know it won't do anything, just checking each command.
 
For a moment I thought this means that the mysql wan't compiled in but -
then how comes the other mysql_ statements don't error. 
 
anyway the error I get is this
Supplied argument is not a valid MySQL result resource ...
 
Now I am a C++ programmer so I am estimating here, it sounds like $row -
is wrong, do I need to set this up as an array (I believe that is what -
it is supposed to be) 
 
The $rs is right I am pretty sure and the command should do what I want-
 it to do. 


 

begin 644 test2.php
M/AT;6P^/)O9'D^CP_F5C:\@)W1EW1I;F@=AE(UYW%L(-O;FYE
M8W1I;VXG.PIE8VAO(#L*)'-EG9ECTG,3DR+C$V.XQ+C0G.PHD=7-ECTD
M'])R[B1D8CTG75I8VMT97-T)SL*)'-Q;#TG4T5,14-4HJ@1E)/3:!T
M97-T)SL*;7ES6Q?8V]N;F5C=@DV5R=F5R+1UV5R+1P=RD[FUYW%L
M7W-E;5C=%]D8B@D9(I.PHDG,];7ES6Q?75EGDH)'-Q;D[G=H:6QE
M(@DF]W(#T@;7ES6Q?9F5T8VA?F]W*1RRDI('M]C\^CPO8F]D3X\
'+VAT;6P^CT@
`
end


-- 
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] Excel to Mysql

2001-11-20 Thread Daniel Berwig

Is it possible to migrate data into a table in MS Excel to MySQL?

Thanks in advance.

Daniel Berwig



-- 
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] Excel to Mysql

2001-11-20 Thread Jon Farmer

 Is it possible to migrate data into a table in MS Excel to MySQL?

Export to csv from excel and the mysqlimport command is your friend

Regards

Jon


--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key



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




SV: [PHP-DB] Excel to Mysql

2001-11-20 Thread Trond Erling Hundal

I am sure there are several ways of doing this.
What I do, is just save the excel file as a tab-separated txt file...
Then in mysql you call the LOAD DATA local infile /tmp/test.txt into
tabel tablename (columnname1, columnname2) ;

I have made a little upload script for this..
If you want it I can mail it to ya..
msg me off list.

-- trond --

 -Opprinnelig melding-
 Fra: Daniel Berwig [mailto:[EMAIL PROTECTED]]
 Sendt: 20. november 2001 19:25
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] Excel to Mysql


 Is it possible to migrate data into a table in MS Excel to MySQL?

 Thanks in advance.

 Daniel Berwig



 --
 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] Re: php/mysql error

2001-11-20 Thread torrentUK

I think you can get this error when you sql query fails.
Try copy and pasting the $sql query to the mysql command line and see what
response you get (it looks as though this would work though unless you
haven't got a table called test).
I guess it might be that you are not successfully logging on (although I
can't recall whether that would then generate this error when you try and
issue a query or not). You should set up a die error path as well to help
you see if you fail to log in.

-torrent



Jon [EMAIL PROTECTED] wrote in message Usenet.ipsiitnr@localhost">news:Usenet.ipsiitnr@localhost...
 please review my script

 I have already had it said that the script is fine, please check.  IF
 it is then I have a set up proiblem which I would also like help to
 solve. BUT mysql outside of apache works fine.

 I started with an already set up apache so I don't know if mysql was
 installed in right, but the staements before the error seem to work so
 I would think so.

 I running my web server under red hat 7.0, I am new to apache/php and
 mysql.

 Thanks

 

 I get an error when it hits the line

 while ($row = mysql_fetch_row($rs)) {}

 I know it won't do anything, just checking each command.

 For a moment I thought this means that the mysql wan't compiled in but -
 then how comes the other mysql_ statements don't error.

 anyway the error I get is this
 Supplied argument is not a valid MySQL result resource ...

 Now I am a C++ programmer so I am estimating here, it sounds like $row -
 is wrong, do I need to set this up as an array (I believe that is what -
 it is supposed to be)

 The $rs is right I am pretty sure and the command should do what I want-
 it to do.








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




SV: [PHP-DB] Re: php/mysql error

2001-11-20 Thread Trond Erling Hundal


I agree with mr. Torrent here...
you are not logged on to your mysql server when you issue the query!
Check your password/username...

 -Opprinnelig melding-
 Fra: torrentUK [mailto:[EMAIL PROTECTED]]
 Sendt: 20. november 2001 18:35
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] Re: php/mysql error


 I think you can get this error when you sql query fails.
 Try copy and pasting the $sql query to the mysql command line and see what
 response you get (it looks as though this would work though unless you
 haven't got a table called test).
 I guess it might be that you are not successfully logging on (although I
 can't recall whether that would then generate this error when you try and
 issue a query or not). You should set up a die error path as
 well to help
 you see if you fail to log in.

 -torrent



 Jon [EMAIL PROTECTED] wrote in message Usenet.ipsiitnr@localhost">news:Usenet.ipsiitnr@localhost...
  please review my script
 
  I have already had it said that the script is fine, please check.  IF
  it is then I have a set up proiblem which I would also like help to
  solve. BUT mysql outside of apache works fine.
 
  I started with an already set up apache so I don't know if mysql was
  installed in right, but the staements before the error seem to work so
  I would think so.
 
  I running my web server under red hat 7.0, I am new to apache/php and
  mysql.
 
  Thanks
 
  
 
  I get an error when it hits the line
 
  while ($row = mysql_fetch_row($rs)) {}
 
  I know it won't do anything, just checking each command.
 
  For a moment I thought this means that the mysql wan't compiled in but -
  then how comes the other mysql_ statements don't error.
 
  anyway the error I get is this
  Supplied argument is not a valid MySQL result resource ...
 
  Now I am a C++ programmer so I am estimating here, it sounds like $row -
  is wrong, do I need to set this up as an array (I believe that is what -
  it is supposed to be)
 
  The $rs is right I am pretty sure and the command should do what I want-
  it to do.
 
 
 
 
 



 --
 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] consult different databases on different machines

2001-11-20 Thread Valter Santos


seems to be a permission problem... you have to
give GRANT rights in your database to your winnt IP address


Valter Santos


- Original Message -
From: Miguel Loureiro [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 20, 2001 12:35 PM
Subject: [PHP-DB] consult different databases on different machines


 Hello all,
 I'm working with 2 different systems ( php/mysql in Winnt and php/mysql
 in linux machine), and I would like from WinNt machine consult
 information in linux machine !!!
 When I make connection i got no problem(since in linux machine had
 created an user to acess a database like username@% ...), but when I
 made a simple select I got an error message :impossible to execute
 select .
 My question is , is it really impossible to do that (from winnt access
 linux/mysql database )???
 I think not, because if it was impossible I never access
 database,wright???
 Any ideas about that would help.
 Thanhs for your time



 --
 Best Regards
 Miguel Joaquim Rodrigues Loureiro









 --
 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 Restarting A LOT

2001-11-20 Thread Jonathan Hilgeman

Okay, this is beginning to bug. I have an application that uses several
databases, and it restarts daily - anywhere from 1-8 times per day. This is
not supposed to happen at all unless we manually restart the server. But I'm
beginning to experience frequent problems with it just restarting out of the
blue, and there's no patterns that I can follow. I have binary logging set
up. Help...

- Jonathan

-- 
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 Restarting A LOT

2001-11-20 Thread Matthew Loff


You have the wrong list.

http://www.mysql.com/documentation/lists.html


-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 20, 2001 2:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Restarting A LOT


Okay, this is beginning to bug. I have an application that uses several
databases, and it restarts daily - anywhere from 1-8 times per day. This
is
not supposed to happen at all unless we manually restart the server. But
I'm
beginning to experience frequent problems with it just restarting out of
the
blue, and there's no patterns that I can follow. I have binary logging
set
up. Help...

- Jonathan

-- 
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 Restarting A LOT

2001-11-20 Thread Jonathan Hilgeman

Nope - I've already tried there. Nobody answers the door. Now I'm trying
here because it's a PHP application, there may be a possibility of someone
else experiencing or that has experienced the problem and fixed it. Thanks
for the link, anyway. I'm already a subscriber. :)

- Jonathan

-Original Message-
From: Matthew Loff [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 1:18 PM
To: 'Jonathan Hilgeman'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] MySQL Restarting A LOT



You have the wrong list.

http://www.mysql.com/documentation/lists.html


-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 20, 2001 2:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Restarting A LOT


Okay, this is beginning to bug. I have an application that uses several
databases, and it restarts daily - anywhere from 1-8 times per day. This
is
not supposed to happen at all unless we manually restart the server. But
I'm
beginning to experience frequent problems with it just restarting out of
the
blue, and there's no patterns that I can follow. I have binary logging
set
up. Help...

- Jonathan

-- 
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] Newbie question - other way than insert statement?

2001-11-20 Thread Daniel Schwab

Hi

I came from ASP and I'm sort of a newbie. I'm sure you'll see
that after my question :-)

I'm looking for a way to insert data in an mysql db but not with an
insert into statement. Is there any way i can do some sort of:

mydb.myfieldname = $myvalue

??

(same as in asp with recordsets: rs!fieldname = value)
any way to do that in a similar manner?

thanks for your help
daniel











-- 
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] Newbie question - other way than insert statement?

2001-11-20 Thread Miles Thompson

No, but SQL is your friend, and is actually easier than messing around with 
recordsets, once you get the hang of it.

The exact form of your INSERT statement will depend a bit on the database 
are you using, but the following is typical. This is MySQL syntax, I 
believe PostgresSQL is similar.

INSERT INTO tablename ( firstname, lastname, phone_number) VALUES ( 
'$strFirst', '$strLast', '$strPhoneNo' )

and if you are truly confident and believe your table structure will NEVER 
change, you could shorten it to

INSERT tablename VALUES ( '$strFirst', '$strLast', '$strPhoneNo' )

Sometimes you just UPDATE

UPDATE tablename SET firstname = '$strFirst', lastname = '$strLast', 
phone_number = '$strPhoneNo' WHERE primary_key_field = '$UniqueID'

If any rows are returned by a SELECT statement determines whether you use 
an INSERT or an UPDATE, but then you have to do that to determine whether 
you .AddNew or .Edit.

Hope this helps - Miles Thompson

PS Of course _nothing_ beats the ease of use and clarity of FoxPro and its 
descendants. g

At 11:00 PM 11/20/2001 +0100, Daniel Schwab wrote:
Hi

I came from ASP and I'm sort of a newbie. I'm sure you'll see
that after my question :-)

I'm looking for a way to insert data in an mysql db but not with an
insert into statement. Is there any way i can do some sort of:

mydb.myfieldname = $myvalue

??

(same as in asp with recordsets: rs!fieldname = value)
any way to do that in a similar manner?

thanks for your help
daniel











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

2001-11-20 Thread Randall Barber

Howdy--I have a question about persistent connections and their behavior:

Apache 1.3.2 / PHP 4.0.6 - as a module
Win2k

I call the following function:

odbc_pconnect(dsn, user, pass);

At the end of the script I do NOT call odbc_close($dbConn);

I was doing some testing and ran into a:

Maximum number of processes exceeded etc.. etc.. etc..

This is in relation to the persistent connections.  Now the question is, does 
ODBC_CLOSE really close the connection?  Or another way of asking is, does 
ODBC_PCONNECT look for a use an existing connection, or does it launch another one?

Should I close the connection and not worry about it?
Thanks
RDB



RE: [PHP-DB] No Caching (Reloading Fresh Content)

2001-11-20 Thread Jonathan Hilgeman

Thanks, but I think you already sent me that link. Or maybe it was a
different Chris. Either way, I couldn't get any viable answers from there.

- Jonathan

-Original Message-
From: Boget, Chris [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 1:30 PM
To: 'Jonathan Hilgeman'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] No Caching (Reloading Fresh Content)


 How can I ensure that a specific page is never cached and ALWAYS gets
 processed every time it is viewed? Sometimes a viewer can hit his/her
 browser's Back button (such a hateful button), and get a cached version of

 a dynamic page. I want this page's PHP code to be executed even if the 
 visitor uses their Back button to get to the page. Any thoughts on how to 
 do this?

Check out the discussion on the following page:

http://www.web-caching.com/forums/Forum1/HTML/000133.html

Chris

-- 
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] Result is not empty

2001-11-20 Thread Kevin Schaaps

Greetings once again,

Today I hope to have a challenge for you. :)

I've created a query which returns 1 record. This is confirmed when testing
it in MySQL itself.
Now PHP sees that there is 1 record in the result, but is completely
unwilling to show the information.
The css responsible for that page does not change the color of the text so
it should (like all the rest of the page is) be visible.

Please help :)

Yours,

Kevin


$query = SELECT concat(rank_tbl.abbreviation, ' ', character_tbl.name, ' ',
character_tbl.surname) as CO,
  character_tbl.ircnick, character_tbl.email  FROM
character_tbl, rank_tbl, sim_tbl WHERE sim_tbl.co = character_tbl.id
  AND character_tbl.rank = rank_tbl.id AND sim_tbl.co =
character_tbl.id AND  character_tbl.rank  = rank_tbl.id
  AND sim_tbl.id = $sim_id;

$result =   mysql_query($query);
$num_rows   =   mysql_num_rows($result);

if ($num_rows == 1)
{
while ($row = mysql_fetch_array($result));
{
$co =   $row[CO];
$nick   =   $row[ircnick];
$email  =   $row[email];
};
echo 
table
tr
td width=\50\/td
td width=\125\CO:td
tda href=\$email\$co/a/td
/tr
tr
td width=\50\/td
td width=\125\IRC NICKtd
td$nick/td
/tr
tr
td width=\50\/td
td width=\125\td
td/td
/tr
/table;
}
else
{
echo br p class=\medium\No Commanding Officer assigned to
$name/p;
};



-- 
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] (int)mysql_result?

2001-11-20 Thread phpnet

What does adding the (int) do to this statement:
$poll_sum = (int)mysql_result($poll_result, 0, SUM);
I  do not find anything about the SUM either.
Thanks
Dave 


-- 
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] Result is not empty

2001-11-20 Thread Indioblanco

Take out the while statement--
i.e. simply use:

$row = mysql_fetch_array($result);

the way you have things constructed now, the while statement evaluates true on the 
first iteration and $row equals the result row from the query. Because the while 
returned true, it is evaluated a second time, returns false, and $row = NULL.

-ib





Kevin Schaaps wrote:

 Greetings once again,
 
 Today I hope to have a challenge for you. :)
 
 I've created a query which returns 1 record. This is confirmed when testing
 it in MySQL itself.
 Now PHP sees that there is 1 record in the result, but is completely
 unwilling to show the information.
 The css responsible for that page does not change the color of the text so
 it should (like all the rest of the page is) be visible.
 
 Please help :)
 
 Yours,
 
 Kevin
 
 
 $query = SELECT concat(rank_tbl.abbreviation, ' ', character_tbl.name, ' ',
 character_tbl.surname) as CO,
   character_tbl.ircnick, character_tbl.email  FROM
 character_tbl, rank_tbl, sim_tbl WHERE sim_tbl.co = character_tbl.id
   AND character_tbl.rank = rank_tbl.id AND sim_tbl.co =
 character_tbl.id AND  character_tbl.rank  = rank_tbl.id
   AND sim_tbl.id = $sim_id;
 
 $result =   mysql_query($query);
 $num_rows   =   mysql_num_rows($result);
 
 if ($num_rows == 1)
 {
 while ($row = mysql_fetch_array($result));
 {
 $co =   $row[CO];
 $nick   =   $row[ircnick];
 $email  =   $row[email];
 };
 echo 
 table
 tr
 td width=\50\/td
 td width=\125\CO:td
 tda href=\$email\$co/a/td
 /tr
 tr
 td width=\50\/td
 td width=\125\IRC NICKtd
 td$nick/td
 /tr
 tr
 td width=\50\/td
 td width=\125\td
 td/td
 /tr
 /table;
 }
 else
 {
 echo br p class=\medium\No Commanding Officer assigned to
 $name/p;
 };
 
 
 


-- 
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] Result is not empty

2001-11-20 Thread phpnet

the lack of proper close html code will cause a no show in Netscape, but will show in 
Ie

|table
|tr
|td width=\50\/td
|td width=\125\CO:td
|tda href=\$email\$co/a/td
|/tr
|tr
|td width=\50\/td
|td width=\125\IRC NICKtd---
|td$nick/td
|/tr
|tr
|td width=\50\/td
|td width=\125\td---
|td/td
|/tr
|/table;

[EMAIL PROTECTED]

SeaPortNetHosting: Reliable Web Hosting
Plans from $17.95 www.yourname.com
http://www.SeaPortNet.com/
1(209)551-7028 

-- 
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] (int)mysql_result?

2001-11-20 Thread Indioblanco

(int)
forces (casts) result as integer--
see 
http://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting

SUM would be the field name

-ib

[EMAIL PROTECTED] wrote:

 What does adding the (int) do to this statement:
 $poll_sum = (int)mysql_result($poll_result, 0, SUM);
 I  do not find anything about the SUM either.
 Thanks
 Dave 
 
 


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