A Php Library For MySQL

Overview

phpSQL

Latest Stable Version Total Downloads License PHP Version Require

MySql İçin Bir Php Kütüphanesi

Herhangi Bir Sorun Olursa Buradan Ulaşabilirsiniz Ayrıca Dosyada Php Documentor Kullanılmaktadır, Modern Editörlerde İşinize Yarayabilir (Sıkıştırılmış Dosya İçin Geçerli Değildir!)

Kurulum

İlk Önce Dosyamızı Dahil Edelim

// Dosya İle
require __DIR__."/phpsql.class.php";
// Composer İle
require __DIR__."/vendor/autoload.php";

Composer Kullanıyorsanız Bu Komutu CMD'ye Yazmayı Unutmayın !

composer require gamerboytr/phpsql

Sınıfımızı Başlatalım

$phpsql = new GamerboyTR\phpSQL();

Eğerki MySQL Ayarlarınız(kullanıcı adı, şifre vs.) Farklıysa Bunu Ayarlayabiliriz

set_config("host", "kullanici_adi", "sifre"); ">
$phpsql = new GamerboyTR\phpSQL("host", "kullanici_adi", "sifre");
// Veya
$phpsql->set_config("host", "kullanici_adi", "sifre");

Komutlar

Hadi Bir Veritabanına Bağlanalım !

$phpsql->set_db("veritabani_adi");

Veritabanından Veri Çekelim

select("*", "üyeler"); ">
$veri = $phpsql->select("seçici", "tablo");
// Örnek
$veri = $phpsql->select("*", "üyeler");

Veritabanında Sorgu(query) Çalıştıralım

query("SELECT * FROM üyeler"); ">
$veri = $phpsql->query("sorgu");
// Örnek
$veri = $phpsql->query("SELECT * FROM üyeler");

Sınıfın Kaydettiği MySql Bilgilerini Alalım

$dize = $phpsql->get_config(); // Bir Array Döndürür

Kolay Bir Şekilde MySql Sınıfını Alalım

connect_errno) die("
Mysqli Bağlanma Hatası : ".$mysqli->connect_error); } catch (\Throwable $th) { die("
Mysqli Bağlanma Hatası : $th"); } ">
// phpSQL ile
$mysqli = $phpsql->connect();
// phpSQL olmadan
try {
    @$mysqli = new mysqli("host", "kullanici_adi", "şifre", "veritabanı");
    if($mysqli->connect_errno)
        die("
Mysqli Bağlanma Hatası : "
.$mysqli->connect_error); } catch (\Throwable $th) { die("
Mysqli Bağlanma Hatası : $th"
); }

Tablo İşlemleri

Tablo Oluşturma

Alabileceği Değerler

  • length - Satırın Uzunluğu / int
  • AI (AUTO_INCREMENT) - Otomatik Artış / boolean
  • unique - Ekstra Olarak (PRIMARY_KEY gibi) / string|null
  • isnull - Boş mu / boolean
  • comment - Açıklama / string|null
"satir_adi", "type" => "varchar" ] ]); ">
$phpsql->create_table("tablo_adi", [
    [
        "name" => "satir_adi",
        "type" => "varchar"
    ]
]);

Tablodan Veri Silme

delete("kullanicilar", "adi='mehmet'"); ">
$phpsql->delete("tablo_adi", "seçici");
// Örnek
$phpsql->delete("kullanicilar", "adi='mehmet'");

Tabloları Listeleme

Eğerki Verdiğiniz Değer Boşsa Kütüphanede Tanımladığınız Veritabanını Kullanır

print_r($phpsql->get_tables("phpsql")); // Bir Array Döndürür

Tabloya Veri Ekleme

"veri_degeri" ]); ">
$phpsql->insert("tablo_adi", [
    "veri_adi" => "veri_degeri"
]);

Tablodaki Veriyi Güncelleme

"guncellencek_veri_degeri" ], "Nerede"); // Örnek $phpsql->update("üyeler", [ "yetki" => "admin" ], "kullanici_adi='gamerboytr'"); ">
$phpsql->update("tablo_adi", [
    "veri_adi" => "guncellencek_veri_degeri"
], "Nerede");
// Örnek
$phpsql->update("üyeler", [
    "yetki" => "admin"
], "kullanici_adi='gamerboytr'");

Veritabanı İşlemleri

Veritabanı Oluşturma

$phpsql->create_db("veritabani_adi");

Veritabanlarını Listeleme

$phpsql->get_dbs(); // Array Döndürür

Veritabanı Silme

drop("phpsql", "database"); // Örnek Tablo Silme $phpsql->drop("üyeler", "table"); ">
$phpsql->drop("tablo_veya_veritabani_adi", "silinecek_tur");
// Örnek Veritabanı Silme
$phpsql->drop("phpsql", "database");
// Örnek Tablo Silme
$phpsql->drop("üyeler", "table");

Kütüphane Ayalarını Kaydetme/Yükleme

Dikkat Kaydedilen Ayarı Yükleyeceğiniz Zaman $phpsql Değişkenini Altına Ayarlamayı Unutmayın !

// Örnek
$phpsql = new GamerboyTR\phpSQL();
$phpsql->restore_config();

Kaydetme

Alabileceği Değerler

  • fileSavePath - Dosyayı Kaydedeceği Klasör (Boş Veya "./" İse O Dizine Kaydedilir) / string
  • overwriteFile - Klasörde Zaten Kaydedilmiş Bir Yapılandırma Ayarı Varsa Üzerine Yaz / boolean
$phpsql->save_config([
    // Değerler Buraya
]);

Yükleme

$phpsql->restore_config("klasor");

Author : GamerboyTR Mail : [email protected] Web : https://www.gamerboytr.ml

You might also like...
Tiny php mysql lib (PDO-based) with handy fetch/update functionality, supports both SQL and parametric queries

Micro PHP mysql lib (~ 200 lines of code) with ultra powerful CRUD for faster than ever development: parametric fetch/insert/update/delete (based on a

Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.

Aura.SqlQuery Provides query builders for MySQL, Postgres, SQLite, and Microsoft SQL Server. These builders are independent of any particular database

A web interface for MySQL and MariaDB

phpMyAdmin A web interface for MySQL and MariaDB. https://www.phpmyadmin.net/ Code status Download You can get the newest release at https://www.phpmy

A validating SQL lexer and parser with a focus on MySQL dialect.

SQL Parser A validating SQL lexer and parser with a focus on MySQL dialect. Code status Installation Please use Composer to install: composer require

MySQL Spatial Data Extension integration with Laravel.

Laravel MySQL Spatial extension Laravel package to easily work with MySQL Spatial Data Types and MySQL Spatial Functions. Please check the documentati

MySQL Load Data Infile Support For Laravel

Laravel Load File 💽 A package to help with loading files into MySQL tables. This uses MySQL's LOAD DATA statement to load text files quickly into you

A mysql database backup package for laravel

Laravel Database Backup Package This package will take backup your mysql database automatically via cron job. Installing laravel-backup The recommende

Laravel Code Generator based on MySQL Database

Laravel Code Generator Do you have a well structed database and you want to make a Laravel Application on top of it. By using this tools you can gener

A Symfony application for managing and automating regular backups of MySQL databases.
A Symfony application for managing and automating regular backups of MySQL databases.

DbSaver DbSaver is an application written by Bastien LOUGHIN allowing you to make automatic daily backups (and manual backups) for your MySQL database

Releases(v1.3.4)
Owner
GamerboyTR
Selam Ben GamerboyTR
GamerboyTR
The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

The Enobrev\ORM library is a small framework of classes meant to be used for simply mapping a mysql database to PHP classes, and for creating simply SQL statements using those classes.

Mark Armendariz 0 Jan 7, 2022
TO DO LIST WITH LOGIN AND SIGN UP and LOGOUT using PHP and MySQL please do edit the _dbconnect.php before viewing the website.

TO-DO-LIST-WITH-LOGIN-AND-SIGN-UP TO DO LIST WITH LOGIN AND SIGN UP and LOGOUT using PHP and MySQL please do edit the _dbconnect.php before viewing th

Aniket Singh 2 Sep 28, 2021
PHP version of mysqldump cli that comes with MySQL

MySQLDump - PHP Requirements | Installing | Getting started | API | Settings | PDO Settings | TODO | License | Credits This is a php version of mysqld

diego torres 1.1k Jan 8, 2023
Symfony 5.2 + api platform project with ELK stack + elastic FileBeats for the log management. All running in 7 docker containers: nginx, php 8, mysql, elastic search, logstash, kibana, fileBeats.

Symfony with ELK and Elastic FileBeats Stack Prerequisites: Make sure that docker and docker-compose are installed in your machine and available for y

null 13 May 20, 2022
A simple PHP and MySQL based internet forum that displays the messages in classical threaded view (tree structure)

my little forum my little forum is a simple PHP and MySQL based internet forum that displays the messages in classical threaded view (tree structure).

Mark Hoschek 97 Dec 29, 2022
phpMyFAQ - Open Source FAQ web application for PHP and MySQL, PostgreSQL and other databases

phpMyFAQ 3.1 What is phpMyFAQ? phpMyFAQ is a multilingual, completely database-driven FAQ-system. It supports various databases to store all data, PHP

Thorsten Rinne 547 Dec 27, 2022
A simple and extensible fixture loader for PHP 7.3+, supporting SQLite and MySQL

Flowder Flowder is a (really) simple fixture loader for PHP 7.3+, supporting SQLite and MySQL. Using Flowder in PHP 7.2 or below? Try version 1 instea

Joe Haines 6 Jan 17, 2021
Connect and work with MySQL/MariaDB database through MySQLi in PHP. This is an introductory project, If you need a simple and straightforward example that takes you straight to the point, you can check out these examples.

First MySQLi PHP Connect and work with MySQL/MariaDB database through MySQLi in PHP. The above exercises are designed for students. This is an introdu

Max Base 4 Feb 22, 2022
Very easy to use PDO MYSQL API. Just Include in PHP file and get it working.

CRUD-MYSQL-API Very easy to use PDO MYSQL API. Just Include in PHP file and get it working. INSTALATION Step 1: git clone https://github.com/arhex-lab

Abdul Raheem 4 Jun 14, 2022
A minimalistic PHP/MySQL anonymous bulletin-board thingy

minibord A minimalistic PHP/MySQL anonymous bulletin-board thingy mostly worked on at night It's a very basic, unthemed, table-based layout, but it wo

null 4 Nov 8, 2022