[PHP-DB] PHP 4.3.4 + Oracle 9i + Apache 2.0.47

2003-11-07 Thread Daniel Sand
Hello,

The system is Solaris sun4u sparc SUNW,UltraAX-i2, SunOS 5.8 i'm 
compiling this with a gcc 3.3.

I'm trying to configure a PHP 4.3.4 with oracle oci8 support.

i've pushed the vars for oracle in the enviroment

ORACLE_BASE=/opt/oracle/app/oracle
export ORACLE_BASE
ORACLE_HOME=/opt/oracle/app/oracle/product/9.2
export ORACLE_HOME
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/lib:/usr/lib:$ORACLE_HOME/network/lib
export LD_LIBRARY_PATH
PATH=$PATH:$ORACLE_HOME/bin:/usr/ccs/bin:
export PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export CLASSPATH
LC_LANG=de_DE
export LC_LANG
LC_ALL=de_DE
export LC_ALL
and the configure with this options run through:

./configure \
--disable-cli \
--without-pear \
--enable-sigchild \
--prefix=${APACHE_DIR}/ext/php-4.3.4 \
--with-apxs2=${APACHE_DIR}/bin/apxs \
--enable-ftp=shared \
--with-mysql=shared \
--enable-sysvsem \
--enable-sysvshm \
--with-oracle=$ORACLE_HOME \
--with-oci8=$ORACLE_HOME
when i start to make the build all runs fine till the oci8 module 
compiling, then a whole bunch off missing functions and wrong syntaxes 
in the code showing up:

/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1191: 
error: request for member `pError' in something not a structure or union
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1191: 
error: request for member `error' in something not a structure or union
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1196: 
error: invalid type argument of `-'
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1196: 
warning: passing arg 1 of `zend_list_insert' makes pointer from integer 
without a cast
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1197: 
error: invalid type argument of `-'
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1200: 
error: invalid type argument of `-'
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1202: 
warning: return makes pointer from integer without a cast
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c: 
At top level:
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1210: 
error: parse error before '*' token
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c: 
In function `_oci_get_ocicoll':
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1212: 
error: invalid operands to binary *
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1214: 
error: `id' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1218: 
error: `collection' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1218: 
error: invalid type argument of `unary *'
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1223: 
error: invalid type argument of `unary *'
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c: 
At top level:
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1234: 
error: parse error before '*' token
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c: 
In function `_oci_get_ocidesc':
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1236: 
error: `desc' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1238: 
error: `id' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1243: 
error: `descriptor' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c: 
At top level:
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1255: 
error: parse error before '*' token
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c: 
In function `_oci_make_zval':
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1258: 
error: `ub4' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1258: 
error: parse error before loblen
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1262: 
error: `column' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1267: 
error: `statement' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1268: 
error: `value' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1276: 
error: `SQLT_RDD' undeclared (first use in this function)
/park/pub/source/www-rom/modules/php4/build/php-4.3.4/ext/oci8/oci8.c:1276: 
error: `mode' undeclared (first use in this function)

[PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

2003-11-07 Thread Karen Resplendo
Apache on NT using MS SQL Srvr 2000
PHP 4.03pl1
 
I return these dates into strings and now I want to compare my database date to see if 
it is later than today's date. Pretty sure my Expires field is a string:
 
Here is the Expires field from the SQL:
Convert(varchar, DATEADD(Year,3,DateCertified),101) AS Expires
 
Here is my PHP code trying to compare dates:
 
$today = date(m/d/Y);
 
   If ($today  odbc_result($data,Expires))
{
 echo brbrLicense has expiredbrbr;
}
   Else
{
 echo brbrLicense has not expiredbrbr;
}
 
Sure could use a simple solution to a simple problem that has me simply confounded.
 
 


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

RE: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

2003-11-07 Thread Oscar Rylin
Strtotime()
Look it up in the manual :-)

-Original Message-
From: Karen Resplendo [mailto:[EMAIL PROTECTED] 
Sent: den 7 november 2003 19:44
To: [EMAIL PROTECTED]
Subject: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

Apache on NT using MS SQL Srvr 2000
PHP 4.03pl1
 
I return these dates into strings and now I want to compare my database date
to see if it is later than today's date. Pretty sure my Expires field is a
string:
 
Here is the Expires field from the SQL:
Convert(varchar, DATEADD(Year,3,DateCertified),101) AS Expires
 
Here is my PHP code trying to compare dates:
 
$today = date(m/d/Y);
 
   If ($today  odbc_result($data,Expires))
{
 echo brbrLicense has expiredbrbr;
}
   Else
{
 echo brbrLicense has not expiredbrbr;
}
 
Sure could use a simple solution to a simple problem that has me simply
confounded.
 
 


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

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



Re: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

2003-11-07 Thread Jason Wong
On Saturday 08 November 2003 02:44, Karen Resplendo wrote:
 Apache on NT using MS SQL Srvr 2000
 PHP 4.03pl1

 I return these dates into strings and now I want to compare my database
 date to see if it is later than today's date. Pretty sure my Expires
 field is a string:

 Here is the Expires field from the SQL:
 Convert(varchar, DATEADD(Year,3,DateCertified),101) AS Expires

 Here is my PHP code trying to compare dates:

 $today = date(m/d/Y);

If ($today  odbc_result($data,Expires))
 {
  echo brbrLicense has expiredbrbr;
 }
Else
 {
  echo brbrLicense has not expiredbrbr;
 }

 Sure could use a simple solution to a simple problem that has me simply
 confounded.

Why not just do the comparison directly within the query?

And if you want to get the above working, have you tried debugging it?

Like:

 print($today);
 print(odbc_result($data,Expires));

Are they what you expected them to be?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Alaska:
A prelude to No.
*/

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



Re: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

2003-11-07 Thread Karen Resplendo
Yes, the values echo out the way I expect them. But these are displayed values, not 
dates, I'm pretty sure, and that is why the comparison is failing.
 
The question began very simply. I will try to make it simpler:
 
How do I compare a string date from a database to today's date using PHP?
I can do it with my eyes closed in SQL. I don't want to if I can avoid it.
 
 

Jason Wong [EMAIL PROTECTED] wrote:
On Saturday 08 November 2003 02:44, Karen Resplendo wrote:
 Apache on NT using MS SQL Srvr 2000
 PHP 4.03pl1

 I return these dates into strings and now I want to compare my database
 date to see if it is later than today's date. Pretty sure my Expires
 field is a string:

 Here is the Expires field from the SQL:
 Convert(varchar, DATEADD(Year,3,DateCertified),101) AS Expires

 Here is my PHP code trying to compare dates:

 $today = date(m/d/Y);

 If ($today  odbc_result($data,Expires))
 {
 echo 

License has expired

;
 }
 Else
 {
 echo 

License has not expired

;
 }

 Sure could use a simple solution to a simple problem that has me simply
 confounded.

Why not just do the comparison directly within the query?

And if you want to get the above working, have you tried debugging it?

Like:

print($today);
print(odbc_result($data,Expires));

Are they what you expected them to be?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Alaska:
A prelude to No.
*/

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


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Re: [PHP-DB] CONVERT STRING VARIABLES TO DATES, THEN COMPARE (HOW?)

2003-11-07 Thread Karen Resplendo

Education  :)

(it seems like such a simple thing to do, to look up, to have in someone's library of 
code, yet. . . . . . .)



 I can do it with my eyes closed in SQL. I don't want to if I can avoid it.

It's more efficient to do so, so can I ask why you want to avoid it?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
A truth that's told with bad intent
Beats all the lies you can invent.
-- William Blake
*/

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




-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

[PHP-DB] Strtotime works for date comparisons on nonUnix--thank you :)

2003-11-07 Thread Karen Resplendo
   $today = Strtotime(date(m/d/Y));
   $expires=Strtotime(odbc_result($data,Expires));
   
   If ($today = $expires)
{
 echo brbrLicense has not expiredbrbr;
}
   Else
{
 echo brbrLicense has expiredbrbr;
}
   
 
 
:-P


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

[PHP-DB] Tristan Pretty is out of the office.

2003-11-07 Thread Tristan . Pretty




I will be out of the office starting  23/10/2003 and will not return until
11/11/2003.

I will respond to your message when I return.
Please contact Fiona or Alan for any issues.



*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP-DB] Re: [PHP] Adding a log file

2003-11-07 Thread John W. Holmes
Erik Osterman wrote:

Consider using this

//
// STDERR logging function
//
function warn( $msg, $die = 0 )
{
$fp = fopen(php://stderr, 'w') or die(Failed to open STDERR);
fwrite($fp, [.strftime(%Y-%m-%d %T).] $msg\n) 
			or die(Failed to write to stderr);
fclose($fp);
if($die)
die($msg);
}
There is also the error_log() and syslog() functions.

http://us2.php.net/error_log
http://us2.php.net/syslog
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


[PHP-DB] RE: [PHP] Adding a log file

2003-11-07 Thread Erik Osterman
Consider using this

//
// STDERR logging function
//
function warn( $msg, $die = 0 )
{
$fp = fopen(php://stderr, 'w') or die(Failed to open STDERR);
fwrite($fp, [.strftime(%Y-%m-%d %T).] $msg\n) 
or die(Failed to write to stderr);
fclose($fp);
if($die)
die($msg);
}
  

This function will log all output to your Apache BASE error log. It's kind
of like Perl's warn function for PHP.


Also, it's good practice to use assertions... look into assert at
http://php.net/assert

Here is some sample usage...

assert_options (ASSERT_ACTIVE, 1);
assert_options (ASSERT_WARNING, 0);
assert_options (ASSERT_QUIET_EVAL, 1);
assert_options (ASSERT_BAIL, 1);
 
// Create a handler function
function assert_callback ($file, $line, $code) {
$body = file($file);
if(empty($code))
$code = trim($body[$line-1]);
print hrfont color=redAssertion Failed:/fontbrul
File '$file'br
Line '$line'br
Code '$code'br/ul;
warn(Assertion failed ($code) in $file on line $line '$code');
print hr;
}
 
// Set up the callback
assert_options (ASSERT_CALLBACK, 'assert_callback');



Regards,

Erik Osterman
http://osterman.com/


 


-Original Message-
From: Robert Sossomon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 7:38 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Adding a log file

I am seeing some errors with a program I wrote and I need to write
everything to a log file that the program is doing.

The following syntax I KNOW is wrong, but not sure they are important to
put here correctly yet.
//script addtocart
$Addcart (info1, info2)
Mysqlquey($addcart)

I am seeing random items NOT being added to my shopping cart.  The
reason, I have no clue. I can pull another catgory of items and the
first 20 will do fine, I go back to the first category I have and the
script seems to work correctly but the data is not written to the
shopping cart.  Problem with the shopping cart???  I wouldn't think so.
Problem with the add page, I don't see how.  So where is the error
coming from?  No clue, which is why I want to log everything.  I use 3
different add pages so that each form uses a different way to add.  This
works for me, and seems to work rather well.  But I need to log
everything on the 3 forms to see where the errors are coming from.

TIA!

Robert
~~~
To rest is to rust. 
~~~

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

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