Performing Simple Database Operations with PHP

I have a database class that I wrote previously and have since improved. It is simple and easy to use.

You can download the class from here and get detailed information about its usage. To give a few examples;

To add data

require "database.class.php";
$ekle = Database::insert("gonderiTablosu", array(
  "baslik" => "Gönderi Başlığı",
  "icerik" => "<p>Gönderi içeriği</p>"
));

if ($ekle) {
  echo $ekle . " ID'li gönderi eklenmiştir";
}

To list data

require "database.class.php";
$gonderiler = Database::getAll("gonderiTablosu", "WHERE durum=?", array("YAYINDA"));
foreach($gonderiler as $gonderi) {
  echo $gonderi->baslik;
}

I hope it helps many people as much as it helped me.
Good luck.

Congratulations, you have created a very successful system. With your permission, I will promote it on my own site as well. Keep developing it :slight_smile:

As you wish, sir. :slight_smile: Thanks for your comment. I couldn’t think of anything else to add. I add new things as I need them. :slight_smile: