Framework for Database Beginner (Easy to Use). This project is beta-test version. You can edit and share your idea.
Download all files from github and extract file into your project directory. Like this : c:/xampp/htdocs/myproject/ And see next tutorial.
Include framework file
require("class.nine.php");
Setting Database Information
$db = new n_database("[user]","[pass]","[host]","[database name]");
Import files
$import = n_render::import_file();
- View all Database function
- Function name
view_all_db $result = $db->view_all_db([display as table = false | true]);- If set to "false" It's will return as array
Array ( [0] => Array ( [0] => information_schema ) [1] => Array ( [0] => cdcol ) )- View all Table function
- Function name
view_all_tbl $result = $db->view_all_tbl([display as table = false | true]);- If set to "false" It's will return as array
Array ( [0] => Array ( [0] => example ) [1] => Array ( [0] => sql_column ) )- View all Column Function
- Function name
view_all_clmn $result = $db->view_all_clmn([display as table = false | true]);- If set to "false" It's will return as array
Array ( [0] => Array ( [0] => test_id ) [1] => Array ( [0] => test_user ) [2] => Array ( [0] => test_pass ) )- View all Data in Table Function
- Function name
view_all_data $result = $db->view_all_data([display as table = false | true]);- If set to "false" It's will return as array
Array ( [0] => Array ( [test_id] => 1 [test_user] => test [test_pass] => test ) [1] => Array ( [test_id] => 2 [test_user] => demo [test_pass] => new_value123 ) )- Update SQL Data
- Function name
sql_single_update_data $db->sql_single_update_data([table_name],[set_column],[new_value],[where_column],[where_value]);- Return null value
- Check Function is disabled or enabled
- Function name
checkFunction $check = n_render::checkFunction([function name]);- Return true if function is enabled, Return false if function is disabled
- Setup File Request (?page=home , ?page=info etc.)
- Function name
setup_request $setup_request = n_render::setup_request($_GET);- Return as file content if it found in "modules/page/[file].php"
- You can add file in "modules/page/" folder
- [Bonus] iFrame
- Function name
iframe $iframe = n_render::iframe([url]);- Return as html tag "<iframe src='[url]'></iframe>"
etc.
Easy to use database connection syntax example like this.
require("class.nine.php");
$db = new n_database("username","password","host","database_name");
$init = $db->select('member')->find('user_id','=','1')->only(array('username','password'))->init();
//Return as array
$cmd = $db->select('member')->find('user_id','=','1')->only(array('username','password'))->get();
//Return SELECT username,password FROM member WHERE user_id=1;