Re: [PHP-DB] SQL for counting comments - is this smart?

2009-03-16 Thread Chris
Martin Zvarík wrote: Is it smart to use all of this on one page? Or should I rather do one SQL and let PHP count it? $q = $DB->q("SELECT COUNT(*) FROM comments"); $int_total = $DB->frow($q); $q = $DB->q("SELECT COUNT(*) FROM comments WHERE approved IS NULL"); $int_waiting = $DB->frow($q); $q

[PHP-DB] SQL for counting comments - is this smart?

2009-03-16 Thread Martin Zvarík
Is it smart to use all of this on one page? Or should I rather do one SQL and let PHP count it? $q = $DB->q("SELECT COUNT(*) FROM comments"); $int_total = $DB->frow($q); $q = $DB->q("SELECT COUNT(*) FROM comments WHERE approved IS NULL"); $int_waiting = $DB->frow($q); $q = $DB->q("SELECT COUNT

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Christopher Jones
Grant Croker wrote: > DYLD_LIBRARY_PATH=/opt/oracle/instanceclient > LD_LIBRARY_PATH=/opt/oracle/instanceclient > ORACLE_BASE=/opt/oracle/instanceclient > ORACLE_HOME=/opt/oracle/instanceclient > export DYLD_LIBRARY_PATH LD_LIBRARY_PATH ORACLE_BASE ORACLE_HOME > > (note: As Chris Jones mentioned

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Grant Croker
On/El 16/03/09 13:03, Mark Halling-Brown wrote/escribió: Grant, thank you very much. You are a life saver. This worked perfectly. Thanks again Mark No problem, g -- Grant Croker - Ingres PHP and Ruby maintainer http://blogs.planetingres.org/grant It was so much easier to blame it on Them.

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Mark Halling-Brown
Grant, thank you very much. You are a life saver. This worked perfectly. Thanks again Mark On 16 Mar 2009, at 11:53 AM, Grant Croker wrote: Hi Mark, you are right /System/Library/LaunchDaemons/org.apache.httpd.plist will not work in your case, it's for the Mac OS X supplied Apache. In y

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Grant Croker
Hi Mark, you are right /System/Library/LaunchDaemons/org.apache.httpd.plist will not work in your case, it's for the Mac OS X supplied Apache. In your case you can edit /usr/local/apache2/bin/apachectl adding the following: DYLD_LIBRARY_PATH=/opt/oracle/instanceclient LD_LIBRARY_PATH=/opt/ora

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Mark Halling-Brown
Hi Grant, Thanks to your instructions, I am making a bit of progress. I have entered the PassEnv commands into the https.conf.: SetEnv DYLD_LIBRARY_PATH /opt/oracle/instanceclient SetEnv LD_LIBRARY_PATH /opt/oracle/instanceclient PassEnv DYLD_LIBRARY_PATH PassEnv LD_LIBRARY_PATH It now seems tha

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Grant Croker
On/El 16/03/09 09:23, chris smith wrote/escribió: On Mon, Mar 16, 2009 at 6:51 PM, Mark Halling-Brown wrote: Thanks for your replies. In my desperation, I declared those environment variables in as many places as I could think of. The script (Although I know I shouldnt), php.ini and also t

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Mark Halling-Brown
Did you restart apache after doing this? Yes, many times The env variables are set correctly for your user, but not apache's (which is the problem). Indeed, I have removed the putenv declarations in the php script and inserted this: echo("Using LD_LIBRARY_PATH: ". getenv("LD_LIBRARY_PAT

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread chris smith
On Mon, Mar 16, 2009 at 6:51 PM, Mark Halling-Brown wrote: > Thanks for your replies. > In my desperation, I declared those environment variables in as many places > as I could think of. The script (Although I know I shouldnt), php.ini and > also the apache httpd.conf file: > > SetEnv ORACLE_HOME

Re: [PHP-DB] Php, Oracle on Mac, with strange behaviour

2009-03-16 Thread Mark Halling-Brown
Thanks for your replies. In my desperation, I declared those environment variables in as many places as I could think of. The script (Although I know I shouldnt), php.ini and also the apache httpd.conf file: SetEnv ORACLE_HOME /opt/oracle/instanceclient SetEnv DYLD_LIBRARY_PATH /opt/oracle/i