[PHP-DB] 2008 : MySQL client run out of memory

2001-08-09 Thread Patrice Garbe

Hello,

I have this error (2008 : MySQL client run out of memory) performing
a request in a script. 
However that request works perfectly under phpMyAdmin ! 

I tried to do a lot of mysql_free_result() in my script (because there are a 
lot of requests) but I doesn't work and I think It is useless.

I looked on the PHP site to see if there's not a bug but I didn't configured
my PHP with the --enable-memory-limit option.
I have the version 4.0.6 with the mysql built-in support. Note that I first
compiled PHP with the external mysql support and I had the same error.

What's the problem ? How to find the cause ?
I tried a debugger called Body but It is so slow that I could die before.

Thank you

Patrice

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

2001-08-09 Thread Patrice Garbe

You must look at the RFC1341 (if you have not already did so) to learn about
mime types. It is also very useful to send (you) messages with attached files
and the look at the source. 

A tip : to send you own forged mail you must use the mail() function like 
this :
maiil($to,$subject,,$your_forged_content);

If you don't want to develop your own solution look at www.freshmeat.net, I'm
sure you will find something.

That's it !

Patrice

Le jeu, 09 aoû 2001, vous avez écrit :
 I would like to send attachment file through mail by using php.  Please
 help me.!!

 Thanks.




 Wen Ni Leong

-- 
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] LDAP and special chars

2001-08-09 Thread Michael Rudel

Hi Christian,

... you could urlencode() when inserting and urldecode() on
fetching the data.

Perhaps this helps.

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -

Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
___

Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: Christian Chateauvieux [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 08, 2001 5:59 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] LDAP and special chars


 Hello,

 I am working with PHP 4.0.6 and OpenLDAP 2.0.11.
 I encounter problems when modifying some entries with
 attributes containing
 special chars (such as å, ø...). The error returned by the
 LDAP server is
 invalid syntax.

 I have read some documentation about this. OpenLDAP can accept
 base64-encoded values, provided we use the tools that come with the
 application (ldapadd, ldapmodify, etc.).
 Then the attributes in the entry would be separated from
 their values by a
 double column instead of the single colums used normally.

 i.e, the entry would be
 dn:uid=whatever,o=whatever
 normalAttribute: normalvalue
 specialAttribute:: SVN==   (this one is B64 encoded)

 But how to do this from PHP functions? I tried to
 base64_encode the values,
 it naturally didn't do the trick (those values were
 considered as normal,
 and thus were not decoded).

 Any idea?

 Thanks in advance


 Christian Chateauvieux



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

2001-08-09 Thread J- E- N

hello!

is there anyone who can give me an idea on how i can write a php script that
can make my table row background blinking.

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] 2008 : MySQL client run out of memory

2001-08-09 Thread Patrice Garbe

I thought I was an answer to my question...I'm disappointed.
Anyway did you try make clean before make ?
But theses parse errors are strange. You should check (if you not already
did so) your gcc version and if all the gcc components are installed.
I had the same problem compiling linuxthreads and It was because
my system wasn't completely installed.

Le jeu, 09 aoû 2001, vous avez écrit :
 I am trying to install PHP 4.0.5 on previous version of php 4.01 on cobalt
 raq 4server. we are getting following error
 cut and paste from linux terminal
 __
 Making all in mysql
 make[2]: Entering directory `/home/src/php-4.0.5/ext/mysql'
 Making all in libmysql
 make[3]: Entering directory `/home/src/php-4.0.5/ext/mysql/libmysql'
 make[4]: Entering directory `/home/src/php-4.0.5/ext/mysql/libmysql'
 /bin/sh /home/src/php-4.0.5/libtool --silent --mode=compile
 gcc  -I. -I/home/src/php-4.0.5/ext/mysql/libmysql
 -I/home/src/php-4.0.5/main -I/home/src/php-4.0.5 -I/usr/include/apache
 -I/home/src/php-4.0.5/Zend -I/u sr/include/freetype -I/usr/include/imap
 -I/usr/interbase/include -I/home/src /php-4.0.5/ext/mysql/libmysql
 -I/home/src/php-4.0.5/ext/xml/expat/xmltok -I/
 home/src/php-4.0.5/ext/xml/expat/xmlparse -I/home/src/php-4.0.5/TSRM 
 -DLINU X=2 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI -Dbool=char
 -DHAS_BOOL -DEAPI -DBIG_SECURITY_HOLE -DCOBALT_RAQ_LED -DSUPPORT_UTF8
 -DXML_BYTE_ORDER=12 -g -O2  -c libmysql.c
 In file included from libmysql.c:9:
 global.h:240: warning: redefinition of `uint'
 /usr/include/sys/types.h:131: warning: `uint' previously declared here
 global.h:241: warning: redefinition of `ushort'
 /usr/include/sys/types.h:130: warning: `ushort' previously declared here
 In file included from libmysql.c:12:
 m_string.h:180: parse error before `__extension__'
 m_string.h:180: parse error before `'
 make[4]: *** [libmysql.lo] Error 1
 make[4]: Leaving directory `/home/src/php-4.0.5/ext/mysql/libmysql'
 make[3]: *** [all-recursive] Error 1
 make[3]: Leaving directory `/home/src/php-4.0.5/ext/mysql/libmysql'
 make[2]: *** [all-recursive] Error 1
 make[2]: Leaving directory `/home/src/php-4.0.5/ext/mysql'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory `/home/src/php-4.0.5/ext'
 make: *** [all-recursive] Error 1
 __



 This is the copy of debug.php
 
 CONFIGURE:   './configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs'
 '--with-gd' '--enable-safe-mode' '--with-config-file-path=/etc/httpd'
 '--with-mysql' '--with-exec-dir=/usr/bin' '--enable-magic-quotes'
 '--with-regex=system' '--with-ttf=/usr/lib/libttf.so' '--enable-track-vars'
 '--enable-xml' '--disable-debug' '--with-interbase=shared'
 '--with-pgsql=shared' '--with-ldap' '--with-imap' '--enable-sockets'
 CC: gcc
 CFLAGS: -g -O2
 CPPFLAGS:-DLINUX=2 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI
 -Dbool=cha r -DHAS_BOOL -DEAPI -DBIG_SECURITY_HOLE -DCOBALT_RAQ_LED
 -DSUPPORT_UTF8 CXX:
 CXXFLAGS:
 INCLUDES:-I/usr/include/apache  -I$(top_builddir)/Zend
 -I/usr/include/fr eetype -I/usr/include/imap -I/usr/interbase/include
 -I/home/src/php-4.0.5/ex t/mysql/libmysql
 LDFLAGS:
 LIBS:   -lldap -llber -lttf -lgd -lresolv -lm -ldl -lcrypt -lnsl 
 -lreso lv
 DLIBS:  -lc-client
 SAPI:   apache
 PHP_RPATHS:
 uname -a:   Linux www.hikanoo.com 2.2.14C11 #2 Wed Jun 28 00:55:51 PDT 2000
 i586 unknown

 gcc -o
 conftest -g -O2  -DLINUX=2 -DMOD_SSL=206104 -DMOD_PERL -DUSE_PERL_SSI
 -Dbool =char -DHAS_BOOL -DEAPI -DBIG_SECURITY_HOLE -DCOBALT_RAQ_LED
 -DSUPPORT_UTF8 conftest.c -lldap -llber -lttf -lgd -lresolv -lm -ldl
 -lcrypt -lnsl  -lresol v 15
 /usr/bin/ld: cannot find -lgd
 collect2: ld returned 1 exit status
 ===

 regards,
 sandeep
 
 Indianic Infotech Limited
 91-79-6404208/09/10
 

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

2001-08-09 Thread Russ Michell

 is there anyone who can give me an idea on how i can write a php script 
 that can make my table row background blinking.

Why on earth would you want to do that?? It would fully distract anyone 
looking at the information within the table - which I *presume* is why 
you want information in the table right? For people to look at and 
assimilate!?

I'm aware of the concept A bad idea - but help out the person anyhow 
but this one is just silly!

Russ

On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N [EMAIL PROTECTED] wrote:

 hello!
 
 is there anyone who can give me an idea on how i can write a php script 
 that can make my table row background blinking.
 
 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]
 

#---#

  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]




[PHP-DB] order by date

2001-08-09 Thread Scott Chapman

Hi,

I am querying a mysql database and am returning data ordered by date, the
trouble is it returns the data from least recent to most recent, I want it
to return the data the other way round.  Is there a way of having the mysql
database doping this re-ordering for me rather than coding it myself?

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] order by date

2001-08-09 Thread Dave Watkinson

you can use order by date DESC 
for descending

or 

order by date
for ascending

nice to see a PHP-Database question in here ;-)


Dave


-Original Message-
From: Scott Chapman [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 10:50
To: [EMAIL PROTECTED]
Subject: [PHP-DB] order by date


Hi,

I am querying a mysql database and am returning data ordered by date,
the
trouble is it returns the data from least recent to most recent, I want
it
to return the data the other way round.  Is there a way of having the
mysql
database doping this re-ordering for me rather than coding it myself?

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]




RE: [PHP-DB] order by date

2001-08-09 Thread Michael Rudel

Hi Scott,

RTFM. Anyway: '... ORDER BY Date DESC' will do the job for you.

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -

Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
___

Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: Scott Chapman [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 09, 2001 11:50 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] order by date


 Hi,

 I am querying a mysql database and am returning data ordered
 by date, the
 trouble is it returns the data from least recent to most
 recent, I want it
 to return the data the other way round.  Is there a way of
 having the mysql
 database doping this re-ordering for me rather than coding it myself?

 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]




Re: [PHP-DB] 2008 : MySQL client run out of memory

2001-08-09 Thread Patrice Garbe

Not at all. The exact error is : 2008 : MySQL client run out of memory
On the mysql online support they say It may happen when a query
returns to much rows. 
But It's not the case. Moreover the query works with phpMyAdmin, which
gives me a bit of hope...

That's all.

Le jeu, 09 aoû 2001, vous avez écrit :
 hello patrice,

 please cut  paste exact error here.. is this related to script timeout

 bye
 sandeep
 - Original Message -
 From: Patrice Garbe [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, August 09, 2001 3:53 PM
 Subject: [PHP-DB] 2008 : MySQL client run out of memory


 Hello,

 I have this error (2008 : MySQL client run out of memory) performing
 a request in a script.
 However that request works perfectly under phpMyAdmin !

 I tried to do a lot of mysql_free_result() in my script (because there are
 a lot of requests) but I doesn't work and I think It is useless.

 I looked on the PHP site to see if there's not a bug but I didn't
 configured my PHP with the --enable-memory-limit option.
 I have the version 4.0.6 with the mysql built-in support. Note that I first
 compiled PHP with the external mysql support and I had the same error.

 What's the problem ? How to find the cause ?
 I tried a debugger called Body but It is so slow that I could die before.

 Thank you

 Patrice

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

2001-08-09 Thread J- E- N

i just want to catch the attention of the user and the blinking effect of
the table row is not forever, it will stop after a certain time. :)


- Original Message -
From: Russ Michell [EMAIL PROTECTED]
To: J- E- N [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 6:41 PM
Subject: Re: [PHP-DB] blinking background


  is there anyone who can give me an idea on how i can write a php script
  that can make my table row background blinking.

 Why on earth would you want to do that?? It would fully distract anyone
 looking at the information within the table - which I *presume* is why
 you want information in the table right? For people to look at and
 assimilate!?

 I'm aware of the concept A bad idea - but help out the person anyhow
 but this one is just silly!

 Russ

 On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N [EMAIL PROTECTED] wrote:

  hello!
 
  is there anyone who can give me an idea on how i can write a php script
  that can make my table row background blinking.
 
  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]
 

 #---#

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

2001-08-09 Thread Dave Watkinson

I guess it's either a timer thing, and change the td bgcolor= or a
timer thing and change the img src= from an animated to a non-animated
GIF

surely there's a better way? bgcolor and background images for tables
are not enitrely cross-browser compliant - why not use JavaScript and
send an Alert? It's more browser friendly than messing with tables :0)


-Original Message-
From: J- E- N [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 11:24
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] blinking background


i just want to catch the attention of the user and the blinking effect
of
the table row is not forever, it will stop after a certain time. :)


- Original Message -
From: Russ Michell [EMAIL PROTECTED]
To: J- E- N [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 6:41 PM
Subject: Re: [PHP-DB] blinking background


  is there anyone who can give me an idea on how i can write a php
script
  that can make my table row background blinking.

 Why on earth would you want to do that?? It would fully distract
anyone
 looking at the information within the table - which I *presume* is why
 you want information in the table right? For people to look at and
 assimilate!?

 I'm aware of the concept A bad idea - but help out the person anyhow
 but this one is just silly!

 Russ

 On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N [EMAIL PROTECTED] wrote:

  hello!
 
  is there anyone who can give me an idea on how i can write a php
script
  that can make my table row background blinking.
 
  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]
 

 #---#

   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]


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

2001-08-09 Thread Michael Rudel

Hi jen,

even if it's silly, here your answer:

It's _not_ possible in PHP, use JavaScript.

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -

Besuchen Sie uns am 20. und 21. August 2001 auf der
online-marketing-düsseldorf in Halle 1 Stand E 16
___

Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: J- E- N [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 09, 2001 12:24 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] blinking background


 i just want to catch the attention of the user and the
 blinking effect of
 the table row is not forever, it will stop after a certain time. :)


 - Original Message -
 From: Russ Michell [EMAIL PROTECTED]
 To: J- E- N [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 09, 2001 6:41 PM
 Subject: Re: [PHP-DB] blinking background


   is there anyone who can give me an idea on how i can
 write a php script
   that can make my table row background blinking.
 
  Why on earth would you want to do that?? It would fully
 distract anyone
  looking at the information within the table - which I
 *presume* is why
  you want information in the table right? For people to look at and
  assimilate!?
 
  I'm aware of the concept A bad idea - but help out the
 person anyhow
  but this one is just silly!
 
  Russ
 
  On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N [EMAIL PROTECTED] wrote:
 
   hello!
  
   is there anyone who can give me an idea on how i can
 write a php script
   that can make my table row background blinking.
  
   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]
  
 
  #---#
 
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]



-- 
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] MSSQL: Spaces in database name

2001-08-09 Thread Miles Thompson


Why have spaces in names at all? To me it's long term aggravation, 
unnecessary keystrokes, and a future source of bugs. Besides, the end user 
rarely sees these names. Another case of do it just because you can?

If this is an inherited database, my apologies. If you are just starting 
the project I beg you to reconsider now.

Curmudgeonly yours - Miles Thompson

At 07:22 PM 8/8/01 -0700, Robert D. Young wrote:
That did it! Using:

... stuff 
$dbname = [Test Database];
... more stuff 
mssql_select_db($dbname);

worked perfectly. Again, Thanks!

- Robert

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 11:46 PM
To: 'Robert D. Young'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] MSSQL: Spaces in database name


i noticed in teh sql of working with some apps that it does things like

[Test Database].fieldname

that might work :)

HTH
Beau

// -Original Message-
// From: Robert D. Young [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 2:39 PM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] MSSQL: Spaces in database name
//
//
// How can I get mssql_select_db to accept a database name with
// spaces in it?
// For example, this:
//
// ... stuff 
// $dbname = Test Database;
// ... more stuff 
// mssql_select_db($dbname);
//
// doesn't work. But if I change to a database with no space in
// the name (like
// Test_Database) it works fine. Other apps (Access, SQL
// Admin, etc.) have no
// problems with a database with a space in the name.
//
// - Robert
//
//
// --
// 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] blinking background

2001-08-09 Thread Miles Thompson

Fergawdsake -- WHY?!!

Irritating, annoying, amateurish -- go read Jakob Nielsen on usability.

Here's an alternate suggestion: A contrasting colour for the row you wish 
to highlight, keeping in mind that some people are colour blind.

Miles Thompson

At 05:53 PM 8/9/01 +0800, J- E- N wrote:
hello!

is there anyone who can give me an idea on how i can write a php script that
can make my table row background blinking.

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] Re: semi newbie Q

2001-08-09 Thread Johannes Janson

Hi,

 Here is a quick question. Cane the mail() function handle file
attachments?
 I couldnt find anything like that on the PHP reference but maybe someone
 knows out there.  If not does anyone have any simple scripts that will
allow
 me to do this?

I think it doesn't. Check e.g http://phpclasses.upperdesign.com/ for a
MIME-class.
Look at the links on php.net

hope it helps
Johannes



-- 
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] 2008 : MySQL client run out of memory

2001-08-09 Thread Patrice Garbe

Hello,

I tried with unbuffered queries and It doesn't solve the problem at all.
I have an weird error performing select id from categories where name = 
'Hifi'.
The error is now : '0 : ' (nothing).

There's an error but it is not defined ?!?

Note that only the crashing query is unbuffered so there's no problem
with mysql_num_rows().

Le jeu, 09 aoû 2001, vous avez écrit :
 guess: try mysql_unbuffered_query . . . also im assuming you arent doing a
 limit on the query where phpmyadmin is . . .

-- 
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] PHP4, MySQL, errors....

2001-08-09 Thread Cato Larsen

Just to have said it... Im green in both PHP4 and MySQL.
Can anyone say what I've been doing wrong here, and how to fix it, or even
better. Debug the whole shit! =)

The error is like this:

--
Members who are $prof s
\n); while ($row = mysql_fetch_array($retid)) { $email = $row[email];
$loc = $row[loc]; $aim = $row[aim]; $icq = $row[icq]; $msn =
$row[msn]; $yahoo = $row[yahoo]; $charname = $row[charname];
$charsname = $row[charsname]; $charnick = $row[charnick]; $tit =
$row[tit]; $lvl = $row[lvl]; $picurl = $row[picurl]; $born =
$row[born]; $apperiance = $row[apperiance]; $charac = $row[charac];
$streng = $row[streng]; $bio = $row[bio]; $breed = $row[breed]; $prof
= $row[prof]; $posn = $row[posn]; echo (
--

Why doesnt it fill in the info instead of printing this above the table?

My code here:

Code start 

?
 $usr = God;
 $pwd = Secret;
 $db = members;
 $host = localhost;

 # connect to database
 $cid = mysql_connect($host,$usr,$pwd);
 if (!$cid) { echo(ERROR:  . mysql_error() . \n); }

?
html
head
titleProfiles/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body bgcolor=#00 text=#FF leftmargin=0 topmargin=0
marginwidth=0 marginheight=0 background=../images/back.gif
bgproperties=fixed
?
 $prof = Nano-Technician;

 # setup SQL statement
 $SQL =  SELECT * FROM memberinfo ;
 $SQL = $SQL .  WHERE prof = '$prof' ;

 # execute SQL statement
 $retid = mysql_db_query($db, $SQL, $cid);

 # check for errors
 if (!$retid) { echo( mysql_error()); }
 else {

  # display results
  echo (PDTBMembers who are $prof s/BBR\n);
  while ($row = mysql_fetch_array($retid)) {
   $email = $row[email];
   $loc = $row[loc];
   $aim = $row[aim];
   $icq = $row[icq];
   $msn = $row[msn];
   $yahoo = $row[yahoo];
   $charname = $row[charname];
   $charsname = $row[charsname];
   $charnick = $row[charnick];
   $tit = $row[tit];
   $lvl = $row[lvl];
   $picurl = $row[picurl];
   $born = $row[born];
   $apperiance = $row[apperiance];
   $charac = $row[charac];
   $streng = $row[streng];
   $bio = $row[bio];
   $breed = $row[breed];
   $prof = $row[prof];
   $posn = $row[posn];

   echo (
table width=846 border=0 cellspacing=0 cellpadding=0
  tr
tdnbsp;/td
td height=30nbsp;/td
  /tr
  tr
td width=80nbsp;/td
td
  table width=766 border=0 cellspacing=0 cellpadding=0
height=166
tr
  td width=150nbsp; /td
  td height=20 align=left nowrap valign=top
table border=0 cellspacing=0 cellpadding=0 height=20
  tr
td height=20 bgcolor=#FFfont
color=#00b$tit
  $charname quot;$charnickquot; $charsname/b/font/td
td height=20 bgcolor=#FFimg
src=../images/profcorn.gif width=20 height=20/td
  /tr
/table
  /td
/tr
tr
  td width=150 valign=top
table width=150 border=0 cellspacing=0 cellpadding=0
height=100%
  tr bgcolor=#FF
td colspan=2 height=2img src=../images/profdot.gif
width=100% height=2/td
  /tr
  tr
td bgcolor=#FF width=2img
src=../images/profdot.gif width=2 height=100%/td
td align=left valign=top
  table width=100% border=0 cellspacing=0
cellpadding=0
tr
  tdimg src=$picurl width=150 height=200/td
/tr
tr
  tdbContact:/b $email/td
/tr
tr
  tdbLevel:/b $lvl/td
/tr
tr
  tdbBreed:/b $breed/td
/tr
tr
  tdbProfession:/b $prof/td
/tr
tr
  tdbLocation:/b $loc/td
/tr
tr
  tdbAIM:/b $aim/td
/tr
tr
  tdbICQ:/b $icq/td
/tr
tr
  tdbMSN:/b $msn/td
/tr
tr
  tdbYahoo!:/b $yahoo/td
/tr
  /table
/td
  /tr
  tr bgcolor=#FF
td colspan=2 height=2img src=../images/profdot.gif
width=100% height=2/td
  /tr
/table
  /td
  td align=left valign=top
table width=100% border=0 cellspacing=0 cellpadding=0
height=100%
  tr
td bgcolor=#FF width=2 rowspan=2img
src=../images/profdot.gif width=2 height=100%/td
td height=2img src=../images/profdot.gif width=100%
height=2/td
td bgcolor=#FF width=2 rowspan=2img
src=../images/profdot.gif width=2 height=100%/td
  /tr
  tr
td align=left valign=top
  

Re: [PHP-DB] blinking background

2001-08-09 Thread Mark Collin

catch the attention of the user hell why don't you just make a blinking
page i'm sure that will grab some attention, and possibly cause a ton of
epillectic fits around the world when people finally do look at your page
e.


- Original Message -
From: J- E- N [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 11:23 AM
Subject: Re: [PHP-DB] blinking background


 i just want to catch the attention of the user and the blinking effect of
 the table row is not forever, it will stop after a certain time. :)


 - Original Message -
 From: Russ Michell [EMAIL PROTECTED]
 To: J- E- N [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 09, 2001 6:41 PM
 Subject: Re: [PHP-DB] blinking background


   is there anyone who can give me an idea on how i can write a php
script
   that can make my table row background blinking.
 
  Why on earth would you want to do that?? It would fully distract anyone
  looking at the information within the table - which I *presume* is why
  you want information in the table right? For people to look at and
  assimilate!?
 
  I'm aware of the concept A bad idea - but help out the person anyhow
  but this one is just silly!
 
  Russ
 
  On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N [EMAIL PROTECTED] wrote:
 
   hello!
  
   is there anyone who can give me an idea on how i can write a php
script
   that can make my table row background blinking.
  
   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]
  
 
  #---#
 
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]




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

2001-08-09 Thread Karl Phillipson

LMAO!


-Original Message-
From: Mark Collin [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 12:34
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] blinking background


catch the attention of the user hell why don't you just make a blinking
page i'm sure that will grab some attention, and possibly cause a ton of
epillectic fits around the world when people finally do look at your page
e.


- Original Message -
From: J- E- N [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 11:23 AM
Subject: Re: [PHP-DB] blinking background


 i just want to catch the attention of the user and the blinking effect of
 the table row is not forever, it will stop after a certain time. :)


 - Original Message -
 From: Russ Michell [EMAIL PROTECTED]
 To: J- E- N [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 09, 2001 6:41 PM
 Subject: Re: [PHP-DB] blinking background


   is there anyone who can give me an idea on how i can write a php
script
   that can make my table row background blinking.
 
  Why on earth would you want to do that?? It would fully distract anyone
  looking at the information within the table - which I *presume* is why
  you want information in the table right? For people to look at and
  assimilate!?
 
  I'm aware of the concept A bad idea - but help out the person anyhow
  but this one is just silly!
 
  Russ
 
  On Thu, 9 Aug 2001 17:53:23 +0800 J- E- N [EMAIL PROTECTED] wrote:
 
   hello!
  
   is there anyone who can give me an idea on how i can write a php
script
   that can make my table row background blinking.
  
   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]
  
 
  #---#
 
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]




-- 
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] Another SELECTING problem :-(

2001-08-09 Thread Dave Watkinson

I've a feeling I've asked this before, but checked my old messages and
couldn't see it in there for the excess of non PHP-Database questions
flying around (yep - that's a joke, but I've been here a while - forgive
me!).
 
I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship. What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.
 
I've tried this...
 
select 
empid, count(empid) 
from 
emp_cont , employers, contacts
where
emp_cont.empid = employers.uid
and
emp_cont.contid = contacts.uid
and
count(empid)  1;
 
and get all kinds of invalid grouping messages
 
many TIA
 
 
Dave
 



RE: [PHP-DB] Another SELECTING problem :-(

2001-08-09 Thread Dave Watkinson

PS This is for a web page, so it's PHP related!!! :-)

-Original Message-
From: Dave Watkinson 
Sent: 09 August 2001 12:51
To: PHP-DB List (E-mail)
Subject: [PHP-DB] Another SELECTING problem :-(


I've a feeling I've asked this before, but checked my old messages and
couldn't see it in there for the excess of non PHP-Database questions
flying around (yep - that's a joke, but I've been here a while - forgive
me!).
 
I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship. What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.
 
I've tried this...
 
select 
empid, count(empid) 
from 
emp_cont , employers, contacts
where
emp_cont.empid = employers.uid
and
emp_cont.contid = contacts.uid
and
count(empid)  1;
 
and get all kinds of invalid grouping messages
 
many TIA
 
 
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] blinking background

2001-08-09 Thread speedboy

 Fergawdsake -- WHY?!!
 
 Irritating, annoying, amateurish -- go read Jakob Nielsen on usability.
 
 Here's an alternate suggestion: A contrasting colour for the row you wish 
 to highlight, keeping in mind that some people are colour blind.

1. You can create an animated gif with the an asterisk * that flashes on
and off light a light bulb (slowly).

2. Or just use the asterisk to denote a certain requirement on a form or
to alert the user to some area of the page.

3. Even changing the color of the text to red will alert the user.

Goodluck and please post to the correct list next time, this has nothing
to do with a database or php for that matter. :)



-- 
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] Another SELECTING problem :-(

2001-08-09 Thread Steve Brett


Dave Watkinson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
PS This is for a web page, so it's PHP related!!! :-)

-Original Message-
From: Dave Watkinson
Sent: 09 August 2001 12:51
To: PHP-DB List (E-mail)
Subject: [PHP-DB] Another SELECTING problem :-(


I've a feeling I've asked this before, but checked my old messages and
couldn't see it in there for the excess of non PHP-Database questions
flying around (yep - that's a joke, but I've been here a while - forgive
me!).

I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship.

three tables defines a many to many relationship.
a one to many is defined by posting a foreign key.
try it with 2 tables.



What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.

I've tried this...

select
empid, count(empid)
from
emp_cont , employers, contacts
where
emp_cont.empid = employers.uid
and
emp_cont.contid = contacts.uid
and
count(empid)  1;

and get all kinds of invalid grouping messages

many TIA


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

2001-08-09 Thread BoNzO

First of all.

Take a look at MIME tutorial @ http://www.zend.com

its great.. read all 3.


i wrote a perl script after that tutorial.. 

it attach a .log file..

take a look im 100% sure you can port it to php using mail() function

just build up $header and insert into the function.

-
#!/usr/bin/perl

use strict;
use MIME::Base64;

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time + 0 *
24 * 60 * 60);
$year += 1900;
$mon++;
if ($mday  10) {
$mday = 0$mday;
}
if ($mon  10) {
$mon = 0$mon;
}

my $baseDir = /home/mysqlBackup;
my $baseFileName = mysql-$year-$mon-$mday;

# mysql--mm-dd.tar(.gz)
my $backupFile = $baseFileName.tar;
my $backupFileType = application/octet-stream;

# mysql--mm-dd.log
my $logFile = $baseFileName.log;
my $logFileType =text/plain;

# Where mysql database are located.
my $DBFileDir = /var/lib/mysql;

doBackup($baseDir/$logFile, $baseDir/$backupFile, $DBFileDir);

my $encBackupFile = _encodeFile($baseDir/$backupFile.gz);
my $encLogFile = _encodeFile($baseDir/$logFile);

sendMail(
Backup completed ($year-$mon-$mday)
, admin\@sineleven.nu
, $logFile
, $logFileType
, $encLogFile
);

sub sendMail {
my ($subject, $to, $File, $FileType, $Base64) = @_;
my $priority = normal;
my $mailprog = /usr/local/bin/sendmail;
my $mime_text = This part of the E-mail should never be seen. If you ar
e reading this, consider upgrading your e-mail client to a MIME-compatible clien
t.\n;
if ($to ne ) {
my $status = open (MAIL,|$mailprog -t);
if ($status) {
print MAIL To: $to\n;
print MAIL Subject: $subject\n;
print MAIL Importance: $priority\n;
print MAIL MIME-Version: 1.0\n;

print MAIL Content-Type: multipart/mixed;\n\tboundary=\
ZEND-12345\;;
print MAIL $mime_text\n;

print MAIL --ZEND-12345\n;
print MAIL Content-Type: text/plain;\n\n;
print MAIL Backup on sineleven.nu completed.\n\nFiles a
re located at /home/mysqlBackup\n\nLook at attached logfile for info\n;

print MAIL --ZEND-12345\n;
print MAIL Content-Type: $FileType;\n\tname=\$File\\n
;
print MAIL Content-Transfer-Encoding: base64\n;
print MAIL Content-Disposition: attachment\n\tfilename=
\$File\\n\n;
print MAIL $Base64\n;
print MAIL --ZEND-12345--\n;

close(MAIL);
}
}
}

sub doBackup {
my ($logFile, $backupFile, $backupDir) = @_;
`tar cvvf $backupFile $backupDir  $logFile`;
`gzip $backupFile`;
`chmod 400 $logFile $backupFile.gz`;
}

sub _encodeFile {
my ($file) = @_;
my ($buf, $encoded);
open(FILE, $file) or die $!;
while (read(FILE, $buf, 60*57)) {
$encoded.= encode_base64($buf);
}
return $encoded;
}

/Mattias aka BoNzO
http://bonzo.sineleven.nu





-- 
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] MS SQL connect by ODBC

2001-08-09 Thread Andrew Hill

Sommai,

Yes, you want to compile PHP --with-iodbc per the HOWTO at www.iodbc.org.
This will give PHP the ability to use ODBC drivers. You will still need to
install an ODBC driver on your linux box, and configure the DSN connection
attributes in your odbc.ini.

You may use OpenLink's Multi-Tier Drivers if you like, which download with a
free 2-connection license and do not expire.
They are available at our website, and free support is available at
http://www.openlinksw.com/support/suppindx.htm if you need assistance.

Hope this helps!

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

 -Original Message-
 From: Sommai Fongnamthip [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 08, 2001 10:33 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MS SQL connect by ODBC


 Hi,
   Did someone ever connect PHP (on Linux box) to MS SQL (on
 NT box) via ODBC
 (iODBC or unixODBC)? How to config and writing code in PHP?

 thanks
 SF


 --
 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] MSSQL: Spaces in database name

2001-08-09 Thread Robert D. Young

I guess it would depend on your view of usability. To me, there's no
shortage of blanks in the world, so I prefer to use them
asOpposedToHopingTheCapitalizationIsPreserved kind of names. Once I finish
designing an app *I* don't have to look at the names much, either, but I
prefer the longer, natural-language friendly form when I come back a year
later to do any needed maintenance.

Old and forgetful,
 - Robert

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 3:57 AM
To: Robert D. Young; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] MSSQL: Spaces in database name



Why have spaces in names at all? To me it's long term aggravation, 
unnecessary keystrokes, and a future source of bugs. Besides, the end user 
rarely sees these names. Another case of do it just because you can?

If this is an inherited database, my apologies. If you are just starting 
the project I beg you to reconsider now.

Curmudgeonly yours - Miles Thompson

At 07:22 PM 8/8/01 -0700, Robert D. Young wrote:
That did it! Using:

... stuff 
$dbname = [Test Database];
... more stuff 
mssql_select_db($dbname);

worked perfectly. Again, Thanks!

- Robert

-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 11:46 PM
To: 'Robert D. Young'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] MSSQL: Spaces in database name


i noticed in teh sql of working with some apps that it does things like

[Test Database].fieldname

that might work :)

HTH
Beau

// -Original Message-
// From: Robert D. Young [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 8 August 2001 2:39 PM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] MSSQL: Spaces in database name
//
//
// How can I get mssql_select_db to accept a database name with
// spaces in it?
// For example, this:
//
// ... stuff 
// $dbname = Test Database;
// ... more stuff 
// mssql_select_db($dbname);
//
// doesn't work. But if I change to a database with no space in
// the name (like
// Test_Database) it works fine. Other apps (Access, SQL
// Admin, etc.) have no
// problems with a database with a space in the name.
//
// - Robert
//
//
// --
// 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] Another SELECTING problem :-(

2001-08-09 Thread Alnisa Allgood

At 12:52 PM +0100 8/9/01, Dave Watkinson wrote:

I have (many many many) tables ... two of which are linked by a third,
so that there can be a one-to-many relationship. What I'd like to do is
find which ids from table 1 have more than one relation in table 2, via
table 3.

I've tried this...

SELECT  empid, COUNT(empid)  FROM emp_cont , employers, contacts WHERE
emp_cont.empid = employers.uid and emp_cont.contid = contacts.uid 
and count(empid)  1;


Your getting a lot of errors, because the statement has well a lot of 
mistakes. Let's start near the beginning, you state:

SELECT  empid, COUNT(empid)  FROM emp_cont , employers, contacts

This statement should produce an error, since you didn't tell the 
database which table to take empid from.  A working statement would 
look like

SELECT  empid, COUNT(empid)  FROM emp_cont   or
SELECT  emp_cont.empid, COUNT( emp_cont.empid)  FROM emp_cont , 
employers, contacts

Either statement provides SQL with implicit instructions, as to which 
empid to use and where.

The next major error is to use a Count function without the group by. 
I'm not an SQL guru, but I believe whenever you use count you must 
also use group by or having so adding a

SELECT  empid, COUNT(empid)  FROM emp_cont GROUP BY empid

will correct that.

Unfortunately, I think the larger issue is how your trying to find 
your query.  Your query did confuse me a little, so I could be wrong, 
but technically speaking, if you are trying to locate an employee 
with more than one record in employee contracts, then there's no need 
to involve the contracts table within the query.

So say I have table Employees that contains empid, name, ssn.  Then I 
have table Employee Contracts that contains, empid, contractid. 
Assuming that all empid(s) on Employee Contracts have a correlating 
empid in Employees (which they will if the table was defined 
properly) then the steps to get what you want are:

Step 1:  Return a Count of empid

SELECT COUNT(empid) AS countid FROM emp_cont GROUP BY empid

Step 2: Return employees with more than one contract

SELECT empid FROM emp_cont WHERE countid 1

You'll note that both step requires a return, which general means a 
subquery, I believe for MySQL to hanle subqueries you actually have 
to perform to separate queries. If your not  using MySQL then you 
could write a statement such as:

SELECT empid FROM emp_cont WHERE (SELECT COUNT(empid) FROM emp_cont 
GROUP BY empid) [note statement may need tweaking since I use MySQL 
and can't test it]

If your using MySQL, I believe you need to return the results from 
one, then use the results to find the next. Or you could use PHP to 
cheat, and return all results, but only display the ones where the 
count is greater than 1.

A subquery is best if your tables are large, returning 1000 results 
to display 50 wastes time. But if you have under 200 employees, then 
just use the SQL statement

$results=mysql_query (
SELECT empid, COUNT(empid) AS countid FROM emp_cont GROUP BY empid);

while ($row=mysql_fetch_array($results)){
$countid= $row[countid];
$empid  = $row[empid];

if($countid==1)
{
$display_employee .=;
}
else
{
$display_employee .=
p$empid/p;
};
}
?
? echo $display_employee; ?

Alnisa

-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
applying technology to transform
   .

-- 
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] Another SELECTING problem :-(

2001-08-09 Thread Dave Watkinson

thanks for that ... I've made some comments within yours...

 

Your getting a lot of errors, because the statement has well a lot of
mistakes. Let's start near the beginning, you state:



SELECT  empid, COUNT(empid)  FROM emp_cont , employers, contacts



This statement should produce an error, since you didn't tell the
database which table to take empid from.  A working statement would look
like
[Dave Watkinson] 
yeah, but empid inly exists in one of the tables in the FROM argument,
so there's no error there 



SELECT  empid, COUNT(empid)  FROM emp_cont   or

SELECT  emp_cont.empid, COUNT( emp_cont.empid)  FROM emp_cont ,
employers, contacts



The next major error is to use a Count function without the group by.
I'm not an SQL guru, but I believe whenever you use count you must also
use group by or having so adding a



SELECT  empid, COUNT(empid)  FROM emp_cont GROUP BY empid
[Dave Watkinson] 
yep - that works :-) 



will correct that.


Unfortunately, I think the larger issue is how your trying to find your
query.  Your query did confuse me a little, so I could be wrong, but
technically speaking, if you are trying to locate an employee with more
than one record in employee contracts, then there's no need to involve
the contracts table within the query.
[Dave Watkinson] 
no - it's employers with more than one contact, hence the names of those
tables in the WHERE bit :-)


So say I have table Employees that contains empid, name, ssn.  Then I
have table Employee Contracts that contains, empid, contractid.
Assuming that all empid(s) on Employee Contracts have a correlating
empid in Employees (which they will if the table was defined properly)
then the steps to get what you want are:


Step 1:  Return a Count of empid



SELECT COUNT(empid) AS countid FROM emp_cont GROUP BY empid



Step 2: Return employees with more than one contract


SELECT empid FROM emp_cont WHERE countid 1


[Dave Watkinson] 
makes sense 


You'll note that both step requires a return, which general means a
subquery, I believe for MySQL to hanle subqueries you actually have to
perform to separate queries. If your not  using MySQL then you could
write a statement such as:



SELECT empid FROM emp_cont WHERE (SELECT COUNT(empid) FROM emp_cont
GROUP BY empid) [note statement may need tweaking since I use MySQL and
can't test it]



that didn't work
 


If your using MySQL, I believe you need to return the results from one,
then use the results to find the next. Or you could use PHP to cheat,
and return all results, but only display the ones where the count is
greater than 1.


A subquery is best if your tables are large, returning 1000 results to
display 50 wastes time. But if you have under 200 employees, then just
use the SQL statement
[Dave Watkinson] 
I *am* using MySQL, but found another way round it - Steve got it right
away - I wanted a one-to-many, not a many-to-many, so I just added an
employer_id column to the contacts table.
 
D'oh!
 
Thanks anyway .. I'm getting used to GROUP now :-)
 
 
Cheers
 
 
Dave
 



Alnisa

-- 
  .
   Alnisa  Allgood
   Executive Director
   Nonprofit Tech
   (ph) 415.337.7412  (fx) 415.337.7927
   (url)  http://www.nonprofit-techworld.org
   (url)  http://www.nonprofit-tech.org
   (url)  http://www.tech-library.org
  .
   Nonprofit Tech E-Update
   mailto:[EMAIL PROTECTED]
  .
   applying technology to transform
  .




Re: [PHP-DB] blinking background fwd

2001-08-09 Thread Russ Michell

Heh, there's a reason the blink tag has been depreciated...  
Actually I tried finding it in the newest version of HTML and can't 
even find it there anymore :-)

That's cos it was a Nutscrape proprietry tag

Russ

Date: Thu, 9 Aug 2001 09:47:59 -0600
From: John Pickett [EMAIL PROTECTED]
Subject: Re: [PHP-DB] blinking background
Sender: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Reply-To: John Pickett [EMAIL PROTECTED]
Message-ID: 006f01c120ea$aac52f10$4c6146a6@notebook


Heh, there's a reason the blink tag has been depreciated...  Actually 
I tried finding it in the newest version of HTML and can't even find it 
there anymore :-)

My 2 ¢
John Pickett http://www.bvstudios.com/
Co-Author:  Inside Dreamweaver 
4 http://www.amazon.com/exec/obidos/ASIN/0735710848/xtremist

- Original Message -
From: speedboy [EMAIL PROTECTED] To: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 6:19 AM Subject: Re: [PHP-DB] blinking 
background


  Fergawdsake -- WHY?!!
 
  Irritating, annoying, amateurish -- go read Jakob Nielsen on 
usability.  
  Here's an alternate suggestion: A contrasting colour for the row you
wish   to highlight, keeping in mind that some people are colour 
blind. 
 1. You can create an animated gif with the an asterisk * that flashes 
on  and off light a light bulb (slowly).
  2. Or just use the asterisk to denote a certain requirement on a 
form or  to alert the user to some area of the page.
  3. Even changing the color of the text to red will alert the user.
  Goodluck and please post to the correct list next time, this has 
nothing  to do with a database or php for that matter. :)
 
  --
 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]

--- End Forwarded Message ---


#---#

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

2001-08-09 Thread travis forden

Depending on the frequency of the blink, it could induce seizures in 
epileptics, aside from being extremely annoying.

Highlighting rows with a sufficiently contrasting color will draw attention 
to the item, and will be seen by color blind visitors.

avoid blink. it's an excellent way to get people to leave your site.



At 11:47 am 2001-08-09, John Pickett wrote:
Heh, there's a reason the blink tag has been depreciated...  Actually I
tried finding it in the newest version of HTML and can't even find it there
anymore :-)

My 2 ¢
John Pickett
http://www.bvstudios.com/
Co-Author:  Inside Dreamweaver 4
http://www.amazon.com/exec/obidos/ASIN/0735710848/xtremist

- Original Message -
From: speedboy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 6:19 AM
Subject: Re: [PHP-DB] blinking background


   Fergawdsake -- WHY?!!
  
   Irritating, annoying, amateurish -- go read Jakob Nielsen on usability.
  
   Here's an alternate suggestion: A contrasting colour for the row you
wish
   to highlight, keeping in mind that some people are colour blind.
 
  1. You can create an animated gif with the an asterisk * that flashes on
  and off light a light bulb (slowly).
 
  2. Or just use the asterisk to denote a certain requirement on a form or
  to alert the user to some area of the page.
 
  3. Even changing the color of the text to red will alert the user.
 
  Goodluck and please post to the correct list next time, this has nothing
  to do with a database or php for that matter. :)
 
 
 
  --
  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: SV: [PHP-DB] Empty error ? (HELP ME)

2001-08-09 Thread Patrice Garbe

hpMyAdmin writes : 3.23.40-log
Why -log, don't know ?...

Le jeu, 09 aoû 2001, vous avez écrit :
 What version of Mysql is it?

  -Opprinnelig melding-
  Fra: Patrice Garbe [mailto:[EMAIL PROTECTED]]
  Sendt: 9. august 2001 19:45
  Til: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Emne: [PHP-DB] Empty error ? (HELP ME)
 
 
  Hello,
 
  Sorry to ask so much questions but I'm in real troubles.
  I have an error 0 performing a query that works with phpMyAdmin.
  This appear in a script that performs a lot of queries before.
  I have PHP 4.0.6 with the mysql built-in support.
  I use unbuffered queries because I had a mysql client run out
  of memory error. I had the same problem with the external
  support.
 
  What can be the cause of the problem ? A lack of memory I suppose
  but why and where ?
 
  Thank you.
 
  Patrice
 
  --
  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] Objects in and out of a DB

2001-08-09 Thread Nigel Gilbert

This is probably a FAQ, but the on-line manual is rather confusing 
and I can't get it to work!

The problem:  I have a fairly complicated set of objects, all 
interconnected through the instance variables of one object storing 
the value of another and so on.  Other instance variables hold 
strings.  I want to store the whole thing in a PostgreSQL database 
and then later recreate the entire hierarchy with everything set up 
as before.

This is what I am using ($zurich is an instance of the Class Zurich):

$s = addslashes(serialize $zurich));
$result = pg_exec($db, UPDATE zurtable SET serializedobject = '$s'
   WHERE name='Zurich');
[error checking omitted]

This puts something sensible into the database; the first few 
characters of what is retrieved using the database front end psql 
looks like this:

O:6:\zurich\:10:{s:7:\players\;a:7:{s:14:\water_supplier\;O:14:\water_supplier\:3:{s:4:\name\;s:14:\water_supplier\;s:10:\reservoirs\;a:5:{i:0;O:9:\reservoir\:5:{s:13:\building_cost\;i:2500;s:11:\repair_cost\;i:2000;s:14:\maintenance_pa\;i:50;s:7:\max_age\;i:10;s:3:\age\;i:4;}i:1;O:9:\reservoir\:5:{s:13:\building_cost\;i:2500;s:11:\repair_cost\;i:2000;s:14:\maintenance_pa\;i:50;s:7:\max_age\;i:10;s:3:\age\;i:1;}i:2;O:9:\reservoir\:5:{s:

 [many lines omitted]

itical_popularity\;i:5;s:19:\supplier_popularity\;i:5;s:13:\env_awareness\;i:5;s:5:\clock\;i:997373335;s:4:\time\;s:31:\Thu,
 
9 Aug 2001 17:08:55 +0100\;}


However, when I come to extract the field from the database using:

$result = pg_exec($db, SELECT serializedobject FROM zurtable WHERE
name='$Zurich');
$row = pg_fetch_array($result,0);
$new_s = $row['serializedobject'];


the output ($new_s) is null.  What am I doing wrong?



-- 
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: PHP4, MySQL, errors....

2001-08-09 Thread Hugh Bothwell


Cato Larsen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Just to have said it... Im green in both PHP4 and MySQL.
 Can anyone say what I've been doing wrong here, and how to fix it, or even
 better. Debug the whole shit! =)

First, make sure PHP is actually running.
Try this:
?php
$str = PHP is not running!;
echo substr($str, 0, 7) . substr($str, 11);
?

For one thing, trying to echo unescaped double-quotes
won't work, ie
echo table leftmargin = 0;// no good!
Use ' or \ instead.

Second, all this variable-renaming seems like a waste
of effort; just use the array directly.


  $cid = mysql_connect($host,$usr,$pwd);
  if (!$cid) { echo(ERROR:  . mysql_error() . \n); }

If the connection fails, your script prints an
error message, then continues trying to query...
if (!$cid) {
echo Error: .mysql_error();
exit;
}
... or redirect them back to a different page.


  # setup SQL statement
  $SQL =  SELECT * FROM memberinfo ;
  $SQL = $SQL .  WHERE prof = '$prof' ;

$sql = SELECT * FROM memberingo 
.WHERE prof='$prof' ;


   echo (PDTBMembers who are $prof s/BBR\n);

dt should only occur in dl.../dl


$apperiance = $row[apperiance];

'appearance'


$prof = $row[prof];

? you already know prof; why query for it?


First thing to do is write a couple of
functions to take care of the formatting
for you:

// Generic tag-formatting routine
//   Ensures all tags are closed properly;
//   Also forces you to think about tag-clause formatting
//so the final result is readable.
function clause($preopen, $tag, $opts, $pretext, $text, $preclose) {
return $preopen$tag $opts$pretext$text$preclose/$tag;
}

function table($contents) {
return clause(\n, table, style='margin-left: 80px;', ,
$contents, \n);
}

function row($contents) {
return clause(\n\t, tr, style='margin-top: 30px;', ,
$contents, \n\t);
}

function cell($text, $width=0) {
if ($text == )// check for empty str
$text = nbsp;;

$opts = ($width  0 ? style='width: $widthpx;' : );

return clause(\n\t\t, td, $opts, , $text, );
}

function bold($text) {
return clause(, b, , , $text, );
}


I would simplify your table, too, at least until
you get it working; play with it after that.


$contents = row(cell(, 150) . cell(, 200) . cell(, 200));

while ($row = mysql_fetch_array($retid))
$contents .= row(
cell(img src='{$row[picurl]}')
   .cell(
bold(
{$row[tit]} {$row[charname]} 
.quot;{$row[charnick]}quot;
.{$row[charsname]}
 ).br
.bold(Contact: ).$row[email].br
.bold(Level: ).$row[lvl].br
.bold(Breed: ).$row[breed].br
.bold(Profession: ).$prof.br
.bold(Location: ).$row[loc].br
.bold(AIM: ).$row[aim].br
.bold(ICQ: ).$row[icq].br
.bold(MSN: ).$row[msn].br
.bold(Yahoo!: ).$row[yahoo].br
 )
.cell(
br
.bold(Born: ).$row[born].br
.bold(Appearance: ).$row[appearance].br
.bold(Position: ).$row[posn].br
.bold(Characteristics: ).$row[charac].br
.bold(Strengths/weaknesses: ).$row[streng].br
.bold(Bio: ).$row[bio].br
 )
);

echo table($contents);


(Note: this approach builds the whole table in memory, in order
to print it out using the clause() function; it might be worth breaking
that out and printing the table a row at a time if there are
many rows in the table.)



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

2001-08-09 Thread Nathan Cavicchi


I made a simple submissions form that writes to a backup file using the
fopen function.  I use the variable a+ or a, for the backup.  it goes to the
end of the file and adds the new info.  I need it to add the new data at the
beginning of the file, but leave the file in tact.  Does anyone have any
ideas on how to accomplish this.  I couldnt really find anything at
php.net.

Nathan


-- 
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] Oracle CLOBs and carriage returns

2001-08-09 Thread Tom Tsongas

Hi folks.

I have an interesting problem with regards to data I am retrieving from
a CLOB stored in my database.

The data consists of several paragraphs of information with multiple
carriage returns and other formatting mechanisms.

Now when I attempt to retrieve the data and display it on the web page,
it comes out as one giant line and all carriage returns and tabbing
seems to have been obliterated.

Here is the code I am using:

$sql_comments = OCIParse($connection,SELECT COMMENTS FROM INCIDENT
WHERE INCIDENT='$incident');
OCIExecute($sql_comments);
while ( OCIFetchInto($sql_comments, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {

$lob_data = $row[COMMENTS]-load();
echo $lob_data;
}

I know the information is stored correctly since a SQL query from the
command line works properly and all formatting is displayed.

Any thoughts?

Tom



-- 
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] Oracle CLOBs and carriage returns

2001-08-09 Thread Anthony Carlos

Tom:

I suspect that your problem is with the HTML, not the CLOB itself. Have you
tried echoing $lob_data in between PRE tags or using the nl2br function in
PHP? It converts nl's to BR tags.

Hope it helps,

Anthony

-Original Message-
From: Tom Tsongas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 2:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Oracle CLOBs and carriage returns


Hi folks.

I have an interesting problem with regards to data I am retrieving from
a CLOB stored in my database.

The data consists of several paragraphs of information with multiple
carriage returns and other formatting mechanisms.

Now when I attempt to retrieve the data and display it on the web page,
it comes out as one giant line and all carriage returns and tabbing
seems to have been obliterated.

Here is the code I am using:

$sql_comments = OCIParse($connection,SELECT COMMENTS FROM INCIDENT
WHERE INCIDENT='$incident');
OCIExecute($sql_comments);
while ( OCIFetchInto($sql_comments, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {

$lob_data = $row[COMMENTS]-load();
echo $lob_data;
}

I know the information is stored correctly since a SQL query from the
command line works properly and all formatting is displayed.

Any thoughts?

Tom



--
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] Oracle CLOBs and carriage returns

2001-08-09 Thread Brian Dunworth


On Thursday, August 09, 2001 at 2:09 PM, Tom Tsongas said: 
 Here is the code I am using:
 
 $sql_comments = OCIParse($connection,SELECT COMMENTS FROM INCIDENT
 WHERE INCIDENT='$incident');
 OCIExecute($sql_comments);
 while ( OCIFetchInto($sql_comments, $row, 
 OCI_ASSOC+OCI_RETURN_NULLS)) {
 
 $lob_data = $row[COMMENTS]-load();
 echo $lob_data;
 }
 
 I know the information is stored correctly since a SQL query from the
 command line works properly and all formatting is displayed.
 
 Any thoughts?

echo nl2br($lob_data);


 - Brian

 --- 
  Brian S. Dunworth
  Sr. Software Development Engineer
  Oracle Database Administrator
  The Printing House, Ltd.
  (850) 875-1500 x225
 --- 

-- 
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] Oracle CLOBs and carriage returns

2001-08-09 Thread Tom Tsongas

Thanks Anthony. The PRE tags worked perfectly!

Tom


Anthony Carlos wrote:

 Tom:

 I suspect that your problem is with the HTML, not the CLOB itself. Have you
 tried echoing $lob_data in between PRE tags or using the nl2br function in
 PHP? It converts nl's to BR tags.

 Hope it helps,

 Anthony

 -Original Message-
 From: Tom Tsongas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 09, 2001 2:09 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Oracle CLOBs and carriage returns

 Hi folks.

 I have an interesting problem with regards to data I am retrieving from
 a CLOB stored in my database.

 The data consists of several paragraphs of information with multiple
 carriage returns and other formatting mechanisms.

 Now when I attempt to retrieve the data and display it on the web page,
 it comes out as one giant line and all carriage returns and tabbing
 seems to have been obliterated.

 Here is the code I am using:

 $sql_comments = OCIParse($connection,SELECT COMMENTS FROM INCIDENT
 WHERE INCIDENT='$incident');
 OCIExecute($sql_comments);
 while ( OCIFetchInto($sql_comments, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {

 $lob_data = $row[COMMENTS]-load();
 echo $lob_data;
 }

 I know the information is stored correctly since a SQL query from the
 command line works properly and all formatting is displayed.

 Any thoughts?

 Tom

 --
 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] Another SELECTING problem :-(

2001-08-09 Thread Alnisa Allgood

At 3:10 PM +0100 8/9/01, Dave Watkinson wrote:
You'll note that both step requires a return, which general means a 
subquery, I believe for MySQL to hanle subqueries you actually have 
to perform to separate queries. If your not  using MySQL then you 
could write a statement such as:

SELECT empid FROM emp_cont WHERE (SELECT COUNT(empid) FROM emp_cont 
GROUP BY empid) [note statement may need tweaking since I use MySQL 
and can't test it]

that didn't work


Yeah, that one shouldn't work on MySQL. MySQL doesn't allow 
subqueries like this.  But here's another option you could use:

SELECT  empid, COUNT(empid)  FROM emp_cont GROUP BY empid HAVING 
COUNT(empid)  1

I tend to use either group by or having, so forgot that having can be 
used to limit a group by. But this statement should work for you, as 
well.

Alnisa
-- 
   .
Alnisa  Allgood
Executive Director
Nonprofit Tech
(ph) 415.337.7412  (fx) 415.337.7927
(url)  http://www.nonprofit-techworld.org
(url)  http://www.nonprofit-tech.org
(url)  http://www.tech-library.org
   .
Nonprofit Tech E-Update
mailto:[EMAIL PROTECTED]
   .
applying technology to transform
   .


RE: [PHP-DB] Another SELECTING problem :-(

2001-08-09 Thread grant

Another possible solution (although more drastic) is to switch DBMS's.  I
use PostgreSQL with no troubles.  However, 6.5 and earlier are not so
great performance wise.  7.0.3 is OK, and 7.1.2 is exceptional.  It also
now (finally) supports outer joins and write ahead locking.

If you are at the beginning of a project, this might not be a big switch.
If you have a lot of data already loaded, this would be an unpleasant
solution.

__

  Your mouse has moved.
   You must restart Windows for your changes to take effect.

#!/usr/bin/perl
print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);



-- 
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] Inexplicable PHP/MySQL behaviour

2001-08-09 Thread Aaron Vegh

Hi there!

Say I have a MySQL table like this:

Away_Team Score Home_Team Score   spread
Atlanta255San Francisco255 2

The team names are loaded into the table before my application starts, and
all scores are given a default value of 255. One one page, I am able to
update the spread (in this case, giving it a value of 2).

Here's where the problem happens. On the page where I want to enter the
scores (the game results), I want each row of that week's schedule to be  a
database entry form, _IF_ no score has been entered before. That is done
using a code fragment like this:

If ($row[home_score] = 255)
run code to output a db entry form

But what happens is, the code ignores the value of 255 and instead prints
out my else... code (which simply outputs the done row with no db entry).
And the funny thing is, IF I DON'T UPDATE THE SPREAD ON THE FIRST PAGE, THEN
THE GIVEN ROW WILL WORK PERFECTLY ON THE RESULTS PAGE. To summarize:

1. If I don't add a spread to the record on the first page, then the results
page works perfectly.
2. If I do add a spread to the record on the first page, then the code
thinks that the $home_score != 255, when in fact it still does.

The only theory I have is that somehow, PHP is getting the wrong value for
the score after the db record has been updated. But I don't understand why!

Any insight anyone can provide would be much appreciated. Please, if you
can, reply directly to my email address as well as this list.

Thanks,
Aaron.


-- 
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] Inexplicable PHP/MySQL behaviour

2001-08-09 Thread Miles Thompson

Aaron,

Try this:
if($row[home_score] == 255)

== is test for equality
= is used for assignment of value

Hope it solves the problem - Miles

PS We've all been bitten by it.


At 09:40 PM 8/9/01 -0400, Aaron Vegh wrote:
Hi there!

Say I have a MySQL table like this:

Away_Team Score Home_Team Score   spread
Atlanta255San Francisco255 2

The team names are loaded into the table before my application starts, and
all scores are given a default value of 255. One one page, I am able to
update the spread (in this case, giving it a value of 2).

Here's where the problem happens. On the page where I want to enter the
scores (the game results), I want each row of that week's schedule to be  a
database entry form, _IF_ no score has been entered before. That is done
using a code fragment like this:

If ($row[home_score] = 255)
 run code to output a db entry form

But what happens is, the code ignores the value of 255 and instead prints
out my else... code (which simply outputs the done row with no db entry).
And the funny thing is, IF I DON'T UPDATE THE SPREAD ON THE FIRST PAGE, THEN
THE GIVEN ROW WILL WORK PERFECTLY ON THE RESULTS PAGE. To summarize:

1. If I don't add a spread to the record on the first page, then the results
page works perfectly.
2. If I do add a spread to the record on the first page, then the code
thinks that the $home_score != 255, when in fact it still does.

The only theory I have is that somehow, PHP is getting the wrong value for
the score after the db record has been updated. But I don't understand why!

Any insight anyone can provide would be much appreciated. Please, if you
can, reply directly to my email address as well as this list.

Thanks,
Aaron.


--
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] 'replace' with 'where'

2001-08-09 Thread Craig Vincent

snip
 $result_insert = mysql_query(replace into wantlist where id =
 '$id' values ('', '$artist', '$title', '$tracks', '', '', ''));
 the $id is already defined in the url, by the way (ex.
snip

The way replace works is it looks for a unique index key in your update
list, if it finds one it uses that key to determine where the REPLACE is
done.

The update command would probably work better for you if all you're wanting
to do is change column values of a record already stored in the table.  It's
also much easier and versatile

Sincerely,

Craig Vincent


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