Marek Kotowski wrote:
What is the practical difference between MySQL
ODBC functions (3.51 Driver) and native mysql
support in PHP (I mean "mysql_" functions available in PHP)?
ODBC is designed for connectivity. If you declare your
database as an ODBC source, any program that understands
ODBC can interact with your database without even knowing
it is in fact a MySQL database.
Native support, in contrast, is designed for performance.
Without an additional middleware layer, databases can be
more robust.
Which functions to prefer, in general and in specific
situations?
When writing PHP/MySQL applications, there is no compelling
reason to use ODBC. ODBC is a Windows-centric technology,
and you don't see a lot of people running PHP applications
on Windows. Most Web hosting providers run on either BSD
or Linux and do not provide ODBC functionality.
You may need ODBC if you are working with less common
database engines (Adabas, SAP DB, DB2, etc.) that do not
have native support in PHP.
Cheers,
NC