Mysql or mysqli ?

This is a discussion on Mysql or mysqli ? within the PHP Language forums, part of the PHP Programming Forums category; I noticed both dlls in the package. I read MySQLi offers Improved MySQL support when using MySQL 4.1 or ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-11-2004
Pjotr Wedersteers
 
Posts: n/a
Default Mysql or mysqli ?

I noticed both dlls in the package. I read MySQLi offers Improved MySQL
support when using MySQL 4.1 or higher
Can anyone tell me in layman's terms why and when I want to use this instead
of 'plain' mysql ?
What features do I get extra ? I have MySQl 4.0.20, according to MySQL site
the latest stable/production release.
Is MySQL 4.1 recommendable ? Should I be implementing everything with MySQLi
from now on anyway ?

Thanks in advance for your opinions & explanations!
Pjotr


Reply With Quote
  #2 (permalink)  
Old 08-11-2004
Tony Marston
 
Posts: n/a
Default Re: Mysql or mysqli ?

I have just upgraded my MySQL 4.0.20 to 4.1.3 on my development PC and I
have discovered one important fact - to access MySQL 4.1.3 or higher you
must use the 'mysqli_' functions as the ordinary 'mysql_' functions do not
work. If you try you will get the following message:

Warning: mysql_connect(): Client does not support authentication protocol
requested by server; consider upgrading MySQL client in
F:\Apache2\HTDOCS\testmysql.php on line 28 Could not connect to MySQL

It is also not possible to access a pre-4.1.3 database with the new
'mysqli_' functions. So when you upgrade to version 4.1.3 of MySQL you must
also upgrade your PHP code. For a lot of people this could be a major
problem but for me it is a simple matter - my code can auto-detect which
MySQL extension is installed then include() the relevant class file at
runtime. I have one class file for the 'mysql_' extension and another for
the 'mysqli_' extension.

This is one big advantage of the 3 tier architecture with its separate data
access component.

--
Tony Marston

http://www.tonymarston.net



"Pjotr Wedersteers" <x33159@westerterp.com> wrote in message
news:411a1cf1$0$34762$e4fe514c@news.xs4all.nl...
>I noticed both dlls in the package. I read MySQLi offers Improved MySQL
> support when using MySQL 4.1 or higher
> Can anyone tell me in layman's terms why and when I want to use this
> instead
> of 'plain' mysql ?
> What features do I get extra ? I have MySQl 4.0.20, according to MySQL
> site
> the latest stable/production release.
> Is MySQL 4.1 recommendable ? Should I be implementing everything with
> MySQLi
> from now on anyway ?
>
> Thanks in advance for your opinions & explanations!
> Pjotr
>
>



Reply With Quote
  #3 (permalink)  
Old 08-11-2004
David Röthlisberger
 
Posts: n/a
Default Re: Mysql or mysqli ?


> I have just upgraded my MySQL 4.0.20 to 4.1.3 on my development PC and I
> have discovered one important fact - to access MySQL 4.1.3 or higher you
> must use the 'mysqli_' functions as the ordinary 'mysql_' functions do not
> work. If you try you will get the following message:


Here's a solution for the problem you mentioned, may be useful for some
people that aren't willing to switch to mysqli.
http://dev.mysql.com/doc/mysql/en/Old_client.html

> Warning: mysql_connect(): Client does not support authentication protocol
> requested by server; consider upgrading MySQL client in
> F:\Apache2\HTDOCS\testmysql.php on line 28 Could not connect to MySQL


kind regards,
David


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0