Giter Club home page Giter Club logo

php-database-class's Introduction

PHP Database Class

PHP Class that handles database Objects and Requests.

It's the result of quite some time of studying the PDO class and the new PHP 7.4 version, along with OO in PHP.

Let's go for the methods.


addConnection

Method to define a database connection

useConnection

This function will set which connection the class should use at the moment

getTotalRequests

It will return the total amount number of requests that were done to the database

performance

It will display a HTML comment on the page, displaying the total amount of time in unix the requisitions had taken

fetch

Will fetch a row. If $simple then only one row and finishes.

fetchAll

Will give all results

count

Will give the number of rows inside the object

empty

If the object is empty, returns true

query

Performns a query

pagedQuery

Breaks the number of results to be shown in a smallest number

setLanguage

Define which language the class should work (default: english)

setPaginationWords

Defines the words inside the pagination HTML when the page method is evoked

getCurrentPage

Will return the current page according to URL

page

Will give the pagination HTML

date

Will give server date

datetime

Will give server datetime

setCollation

Will generate a SQL to change whole database collation. Returns a string, and can apply it too.

setFriendlyURL

Will stablish the FriendlyURL instance

prepare

Will prepare a SQL

set

Will bind value to a prepared SQL

formatMonney

Will make the value a monetary one

insert

Will insert $data inside $table. If $additional is given, will transform values

id

Returns last inserted id

update

Updates $data in $table using given $rules. $additional is supported too.

delete

Will delete whole table if $rules is omitted

URLNormalize

Makes given string url friendly

search

Simple search engine. It uses the content inside database (so, if database doesn't have much records...)

php-database-class's People

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.