Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- ODBC or native functions?
- Marek Kotowski
March 1, 2005, 7:58 am
rate this thread
I am new to MySQL and PHP programming.
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)?
(the same question applies to PostgreSQL native functions).
Which functions to prefer, in general and in specific situations?
Thank you in advance.
Re: ODBC or native functions?
Marek Kotowski wrote:
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
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.