₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,345,011 members, 8,514,993 topics. Date: Saturday, 07 November 2026 at 08:05 PM

Toggle theme

PHP Workouts-sqlite3 CLASSES (wrapping Or Extending) - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › PHP Workouts-sqlite3 CLASSES (wrapping Or Extending) (1330 Views)

1 Reply

PHP Workouts-sqlite3 CLASSES (wrapping Or Extending) by Kidstell(op): 12:13pm On Aug 27, 2013
These are ways of utilizing the sqlite3 class. Which will you choose and why or better still which of these is the BEST

method 1 extending
<?php class MyDB extends SQLite3{
function __construct(){ $this->open('test.db');}
}
$db =new MyDB();
if(!$db){
echo $db->lastErrorMsg();
}else{
echo "Opened database successfully\n";
}
?>

method 2 wrapping
class MyDb {
function __construct(){
$data=new sqlite3();
$data->open('test.db');}
}
$db =new MyDB();
if(!$db){
echo $db->lastErrorMsg();
}else{
echo "Opened database successfully\n";
}
?>
Re: PHP Workouts-sqlite3 CLASSES (wrapping Or Extending) by Kidstell(op): 5:29pm On Sep 03, 2013
I used to think we 've got sure ethical programmers here. Why is nobody talking, there are no rules here.
Well i will really like to use the Extend because it gives of access to predefined functions and i won't need to re-invent any wheel. Also i 'll be able to create functions that call the predefined functions without creating a new object instance of the sqlite3 class, this helps save ram space. Lets talk
1 Reply

[MOD] PHP WORKOUTS - String Manipulation 1 • [MOD] PHP Workouts-email Validation In Php Using Any Method. • Abstract, Interface And Adapter Classes • 2 • 3 • 4

Help Installing Tecno N3 Drivers On Windows 8. • Pls Free School Management Software • Good News For Every Nigeria Developer..finally Nigeria Is Ready For Tech.