This is a simple class with inside a lot of common methods useful for every kind of php project.
Many time a programmer will use the same script or a simply tow or three line of the same portion to
repeat the same classic operation. This utility let the programmer the time to think to his patterns
and forget repetitive procedures like a date format, a byte conversion or more complex the creation
of  object classes starting from a resultset.


Download here the zip file clicking the link below

PhpUtils (507)

For this class documentation go to:
phputils documentation


Some examples below:

  1. <?php
  2. require_once("PhpUtils.php");
  4. $link_id = mysql_connect("localhost", "root", "");
  5. mysql_select_db("mysql");
  7. //PhpUtils::getResultCounter
  8. $sql = "SELECT count(*) as total_rows from user";
  9. echo PhpUtils::getResultCounter(mysql_query($sql));
  11. //PhpUtils::getObjectsFromResults
  12. require_once("DbMySql_initializer.php");
  13. class User extends DbMySql_initializer
  14. {
  15. public $Host;
  16. public $User;
  17. };
  19. $sql = "SELECT * FROM user";
  20. $els = PhpUtils::getObjectsFromResults(mysql_query($sql), "User");
  21. foreach($els as $user)
  22. {
  23. echo $user->User;
  24. echo "<br />";
  25. }
  27. ?>


Log of changes

October 11, 2012

  • Fix some bugs and add compatibility with many differents kind of mysql pointer or restult types as
    • mysqli class
    • mysql standard link
    • mysqli direct link


September 08, 2012

  • getResultCounter – Now accept different kinds of result objects to process the class creation
  • resizeImage – Edit to work without codeigniter and add the possibility to resize only the height of an image with imagemagick


DBPersister Comments

DBPersister comments

Powered by Facebook Comments

DB Persister is a library written for php language that helps you to use simply and clearly your database taking advantage of the powerful object oriented programming


Get every new post on this blog delivered to your Inbox.

Join other followers: