Giter VIP home page Giter VIP logo

easysqli's Introduction

Mysqli prepare statement class

License: MIT

This PHP class lat you perform Mysqli prepared statements in just one line.

Documenttation:

Construct the object

The first and only parameter in the constructer is an array with host, username, password and database name for the mysql server

$sqli = new sqli(["127.0.0.1", "", "", "test"]);

Find more examples in Example.php

push, pull_once and pull_multiple metode

Parameters

$query - standard sql statement with question marks as placeholders

$dataMode - string with the number of variables and length of string, types must match the parameters in the statement.

i for integer

d for double

s for string

b for blob and will be sent in packets

$parameters - array of variables for the placehoders

Return

All the metohed retun a standart object with following parameters, and some more for the spefic methodes

status: true if the prepare method in the ordinery mysqli class return true

error_msg: error from the connection if the prepare methode returns false

affected_rows: affected rows from the sql statement

push method

$sqli->push("insert into test (msg) VALUES (?)", "s", "Just a test");

Find more examples in Example.php

Do also return following:

id: the id there has ben insert if sql statement was a insert statement

pull_once method

$sqli->pull_once("SELECT msg as message FROM test WHERE id=?", "i", 1);

Find more examples in Example.php

Do also return following:

data: array of the feilds of the (first) row there has ben selected, empty array of nothing has ben selected

count: the row count there has ben selected from the sql statement

pull_multiple method

$sqli->pull_multiple("SELECT id, msg as message FROM test");

Find more examples in Example.php

Do also return following:

data: array of the rows there has ben selected from the sql statement, each item is a array of the feilds

count: the row count there has ben selected from the sql statement

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.