I must confess I am perplexed when I look at the database functions in PHP, because 
they seem to include many exotic functions
(whose use I can scarcely imagine) and to exclude a few functions which I would regard 
as essential.  I should specify that my
current concern is regarding Microsoft SQL Server.

Now, I'm not a particular fan of Microsoft, but one must recognise the fact that it is 
one of the most popular (if not *the* most
popular) databases in the marketplace today.  I'm assuming we can also agree that PHP 
is good for far more ambitious projects than
shopping-cart applications based around MySQL.  I have a feeling that for today's 
medium-to-large companies, a web-based database
application running on an intranet is an attractive solution, offering tremendous 
advantages in simplifying maintenance and
installation of client software.

However, were I to be approached by a company to build such an application (based 
around SQL Server), I would probably have to turn
to Cold Fusion or ASP.  Why?  Well, I am a simple soul and find I can do anything I 
need to do with a few simple routines, namely
submitting SQL Queries to the server.  I'm not interested in client-side cursors or 
anything like that.  Just give me a quick,
read-only, forward-scrolling result set and I'll do the rest.  I'm quite capable of 
constructing strings like 'EXEC myproc 1, 2, 3'
on the fly, so I don't need special routines to handle stored procedures.

All the same, there is one bit of functionality that I regard as essential: I must 
know if the SQL commands I submit succeed or not,
and if not - why not.  With PHP4, there is no way of knowing if an UPDATE, INSERT or 
DELETE was successful (with SQL Server 7.0).
With PHP3, you know if it failed, but the error message you obtain from 
mssql_getlasterror is always the same: "The statement was
terminated.".  This tells you absolutely nothing.

I was even more dismayed to find that there is no error function in the ODBC routines 
at all!  This is quite incredible, given that
the ODBC API contains a function expressly for this purpose - SQLDiagRec.  (This is a 
handy function that allows you to loop through
any number of messages the server may return.)

I would recommend that you consider providing some means of obtaining meaningful error 
messages from SQL Server 7.0 as a matter of
some urgency, either through the mssql libraries or through ODBC.  (I understand that 
it is now possible to run SQL Server on Linux,
and a few sites are now doing this as a concession to their Microsoft-fixated clients!)


Matthew Fisher

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

Reply via email to