RE: [PHP-DB] Re: ADODB - whaddya think?

2002-05-20 Thread Jerome Houston

Benjamin-

first of all, the ADODB that ruprecht is talking about is different than the 
one i'm talking about.  go to http://php.weblogs.com/ADODB for the one i'm 
talking about.  the one i'm talking about does have support for the one he's 
talking about built in, though.  the one i'm talking about is what appears 
to be a decent attempt to standardize all of the DB functions/extensions in 
php into a set of DB calls that could potentially be used on any database, 
as long as you had the right extensions loaded already.  basically it 
defines a few of the standard DB functions connect(), execute($somequery), 
close, etc... and depending on what DB type you pass it,   these standard 
functions wrap around the appropriate DB functions for your DB (like 
mysql_connect(), mssql_query(), ovrimos_execute(), etc...) so it turns out 
that using this package doesn't help me, because it's still limited by the 
functionality of mssql_*() functions.

what limits do i speak of?  2 in particular (in the current php - they 
should be gone by 4.3)
1.  if a table in your DB has a column full of MSSQL's 'real' type, if the 
precision of the data is too high, like 3.443932, php just straight up 
crashes.  no error log, no nuthin.
workaround:  instead of Select real1, string1 from table, do select 
round(real1,{some lower precision}), string1 from table

2.  if you have multiple SQL statments in a call to mssql_query(), and some 
of them don't actually return a result set like:
mssql_query(declare var1 float
set var1=12.34
select var1 as var);

mssql_next_result() won't do the right thing and you won't be able to get to 
the result set generated by the last statement.  Also, for some reason, when 
this problem occurs, it causes all subsequent mssql_*() functions to do 
zilch.  workaround: figure out a way to only have 1 SQL statement per call 
to mssql_query() (not easy sometimes depending on what you're doing)

well, this has been long, but i hope informative, too.

-jerome

Original Message Follows
From: Ruprecht Helms [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Benjamin Walling [EMAIL PROTECTED]

Hi Benjamin Walling,
  I'm starting to migrate from ASP to PHP.  What are you finding that you
  can't to with mssql_*?  I'd be interested in knowing what limitations I 
may
  be facing.

By myself I'm using ADODB in my actual Project. But this Project
is in VBA based on Access. ADO itselv consits of ActiveX-Components and
I don't know of the securance of this Components at the moment. From MS
you can hear from time to time that are always big bugs in Security.
For example Exchange-Server, IIS, SQL-Server, ...

To take PHP is the right way. I suggest you take mysql (Linux-Version),
Adabas D or Oracle as database and connect it with php. Then you have
less trouble in security. The linuxbased mysqlversion is much stable
and is freeware (the win-version of mysql is shareware).

Regards,
Ruprecht

--
E-Mail: Ruprecht Helms [EMAIL PROTECTED]
Date: 18-May-02
Time: 09:39:50

to be informed - http://www.rheyn.de -

This message was sent by XFMail
--

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


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP-DB] MSSQL2000 'real' data type and multiple SQL statments in one mssql_query()

2002-05-14 Thread Jerome Houston

Apologies for the repeat to those who are in php-general and php-windows.
i'm running PHP4.1.1 as a module through Apache 1.3.22 on W2k Server SP2 -- 
connecting to a MSSQL server running on the same OS.

I'm having 2 problems with the system.
1.  on mssql_query(*SELECT statments*); that return MSSQL's 'real' number 
that have super high precision, php just dies.  no log in the error log - 
and a connection with the server was reset from the browser

2.  putting multiple SQL statments into a mssql_query() doesn't return a 
proper result set, and render other mssql_*() functions non-functional for 
the rest of the execution of the script.

explanation of #1:

database snippet comment=Inventory column is of type 'real'
codeinventory name
PRC01   2.33  Prince Brand Chips
FCA13   9.934E-2  Frozen Calamari
/database snippet

when i
mssql_query(select * from products);
or, more specifically
mssql_query(select inventory from products where code = 'FCA13');

BOOM!  php crashes, and i get a pop-up window in MSIE that says, IE cannot 
open the site ..  the connection with the server was reset

but
mssql_query(select * from products where code = 'PRC01'); works like a 
charm.

granted 9.934E-2 isn't an actual number for inventory, it should be 
0.10.  BUT, i can't help that.  my application is not the only one that uses 
this data.  This happens on various number with extremely high precision 
(3.400E-8, 9.938E-3, etc...)

explanation of #2:

someone gave me a possible solution to #1: SET TEXTSIZE 2048 before the 
select.
but when i do:

mssql_query(SET TEXTSIZE 2048 select inventory from products where code = 
'FCA13');

I get:

Warning: Supplied argument is not a valid MS SQL-result resource in
utils.php on line 50

AND, from then on, no mssql_*() functions work

Warning: MS SQL: Unable to select database: PRODDB in utils.php on line 48

Warning: MS SQL: Query failed in utils.php on line 50

Warning: Supplied argument is not a valid MS SQL-result resource in
testms.php on line 72

It turns out when i do any query with mutliple statements in it (even if i 
don't use the result set for something), it causes the same thing.  all 
mssql_*() functions are rendered non-functional. even something that doesn't 
access data in the DB, like:

mssql_query(declare P1 float \n set P1 = 10.00 \n select P1);

i get the not a valid MS SQL-result resource error.

is there a setting i can change to make multiple statements OK for PHP?  I 
know the statements run just fine on the SQL server, because i ran MSSQL 
Profiler on the server to catch all statments and errors, and no errors 
happened. but all of the mssql*() calls that come after don't even make 
it to the SQL server.

Thanks for reading a long email, and any help that can be given.

jerome



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP-DB] Problems with Oracle connections

2001-03-29 Thread houston

Have you tried supplying the optional third parameter to ociplogon() to
specify the connection?

ociplogon( "username","password","tns_alias");

--Houston

""bgadelha"" [EMAIL PROTECTED] wrote in message
Hi,
I'm having troubles using PHP+Oracle.
I´m under Win98, with Apache WebServer, PHP4 and Oracle.
When I try to connect, the following error message is
displayed:

Warning: Unable to connect to ORACLE (ORA-12154:
TNS:could not resolve service name) in
c:\apache\htdocs\testeoracle.php on line 24
falhou outra vez:ORA-12154: TNS:could not resolve
service ...



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

2001-03-29 Thread houston

In his excellent book "Core PHP Programming", Leon Atkinson says that PHP
supports Perl-style "HERE docs".  I have tried to make this work with
PHP4.04 with no success.  I also haven't found any reference to HERE docs in
the PHP documentation.  Is this really supported in PHP?



-- 
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] managing large result sets

2001-03-28 Thread houston

I have to deal with displaying result sets that could potentially be quite
large.  It would be bad form to drop 10,000 rows into a browser table so I
need a strategy for dealing with this possibility.

It's obviously not a big deal to limit the output but what is the typical
strategy for handling next previous behavior?  It seems terribly
inefficient to requery for a subset each time.  I suppose that I could dump
the entire result set to a text file keyed to the session but that raises
the problem of garbage collection with potentially large files.  Anyone have
experience with this problem?

Thanks--Houston



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