PHP class for interaction with BD MySQL

2

Does anyone know of any PHP class for MySQL integration, using the mysqli_* and prepared statements function?

I have these two examples here:

asked by anonymous 04.07.2014 / 16:16

4 answers

2

Medoo

I have the medoo ( link ) it uses PDO and not mysqli, but it has many features: joins, all basic operations, WHERE, AND , and many others [listed in documentation]. In addition to excellent security and documentation , it speeds development.

It is also very practical and has a reasonable system of errors.

  

Documentation: link

     

Download: link


But if you really need something advanced I recommend using mysqli / PDO itself and start programming, frameworks speed up and make it easier, but sometimes they are very limited.


Note

I've given a class with PDO because PDO and mysqli have almost the same features and it was the best I found, and I very much doubt that your hosting does not support PDO, if it does not support I'd suggest switching hosts.

Note 2

This is just a SUGGESTION , there are several frameworks / classes out there, you can even make yours, but do not take my opinion as the best or right (may be), but expect others even before the OS is intended to have good answers that can be seen by others in the future, and the range of answers here can be somewhat "broad".

    
05.07.2014 / 00:42
2

If you are looking for solutions with ORM you have

PHP Active Record or ORM Doctrine

    
05.07.2014 / 02:57
1

You can use MySQLi itself

PHP

$db = new mysqli("localhost", "usuario", "senha", "meubanco");

Usage

PHP

$resultado = $db->query("SELECT * FROM tabela");
while($row = $resultado->fetch->array()) {
  echo $row["campo"];
}

More information on PHP Manual

    
04.07.2014 / 17:53
0

If it is going to be done in the hand, I advise using PDO, functions like mysql_connect and the like, are deprecated. More current versions of php already trigger deprecated warning when they appear in code.

If you want to use some lib ready, I recommend link

    
07.07.2014 / 17:20