Skip to content

Simple MySQLi wrapper to handle common database queries and operations.

License

Notifications You must be signed in to change notification settings

komputronika/SimpleDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleDB

SimpleDB is MySQLi wrapper to handle common database queries and operations.

Include file:

<?php
require("mysqlidb.php");

//...

Connect to database:

db_connect("localhost","user","pass","student");

Get records example:

$q = db_query("select * from students");
while ($d = db_fetch($q)) {
    print "$d->id, $d->name <br />";
}

Insert example:

$a = array();
$a['name'] = db_filter($_POST["name"]);
$a['age']  = db_filter($_POST["age"]);

db_insert("student", $a);

Update example:

$a = array();
$a['name'] = "John Doe";
$a['age']  = 21;

db_update("student", $a, "id=10");

Delete example:

db_delete("student", "id=5");

Get last insert id:

//...
db_insert("student", $a);
$last_id = db_last_id();

About

Simple MySQLi wrapper to handle common database queries and operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages