PHP Classes

Mysql_Connect

Recommend this page to a friend!

      Simple CRUD with MySQL 2  >  All threads  >  Mysql_Connect  >  (Un) Subscribe thread alerts  
Subject:Mysql_Connect
Summary:Why???
Messages:5
Author:Ken Turnbull
Date:2018-01-23 18:48:41
 

  1. Mysql_Connect   Reply   Report abuse  
Picture of Ken Turnbull Ken Turnbull - 2018-01-23 18:48:41
Why are you still using legacy mysql connection information in this day and age??

While your approach to CRUD has some interesting aspects, your use of mysql and not MySqli or even PDO is, in my opinion, problematic and indicative of a lack of knowledge of current practice.

I am including in the next paragraph a warning that I have seen in various forms and posts for many years now about MySQL connections...

"The original PHP MySQL functions (whose names begin with mysql_) are deprecated in PHP 5.5, and will eventually be removed from PHP. Therefore, you should only use these functions when absolutely necessary for backward compatibility. If possible, use the MySQL Improved extension or PDO instead."

It is not hard to use the newer functionality and in fact PDO is very easy and very convenient.

Maybe an update to your code is in order

  2. Re: Mysql_Connect   Reply   Report abuse  
Picture of Marco Sillano Marco Sillano - 2018-01-24 10:13:19 - In reply to message 1 from Ken Turnbull
You have reason, my friend, but...

All DB accesses are in an unique file (irp_commonSQL.php), so it will be easy to rewrite it using MySqli, or any other lib, by some knowing the current practices.

I'm waiting for such collaboration ! :)

Wat say more? it works for me from many years, and I'm (very) lazy :)


Best regards.
m.s.

  3. Re: Mysql_Connect   Reply   Report abuse  
Picture of Ken Turnbull Ken Turnbull - 2018-01-24 16:05:43 - In reply to message 2 from Marco Sillano
I will rewrite in PDO

  4. Re: Mysql_Connect   Reply   Report abuse  
Picture of Marco Sillano Marco Sillano - 2018-04-22 12:47:45 - In reply to message 3 from Ken Turnbull
You did it?
I am very anxious :)

Best regards.

  5. Re: Mysql_Connect   Reply   Report abuse  
Picture of Marco Sillano Marco Sillano - 2020-02-11 10:46:09 - In reply to message 4 from Marco Sillano
Now done ;)

The actual version 4 uses a PDO common module to connect DB !!!
All happy