Where is the polymorphism and inheritance? Not really oop as it could be done with functional programming. Also, putting the disconnection in the __destructor might be easier to read in the code logic as you could simply delete the object. I don't like the die() in the method, either. .A better implementation would be to have objects for different tables inheriting from a base (possibly abstract) object or interface. The child obs would specialise their behaviour and properties.
its a nice one for the beginners.. however, you can make it way better with some constructors/destrucors and, interface and static methods. futhermore, there is no reason to leave all the objects public
you include the php class file then use $database->functionname , the $database-> but whatever you named your instance is what youll use if that makes sense?
so like new to create a new instance of the class database you'd do $whatuwannacallithere = new Database() ;[new database cos thats the name of the class] then you include it into the file and do $nameyoucalled it->function_you_want
I would like to thank you for this tutorial by this huge lack of OOP that made the people who do not yet understand the use of classes. I am speaking particularly for little or no experience in OOP and videos like this really makes a huge difference to who is to begin programming in OOP.
Where is the polymorphism and inheritance? Not really oop as it could be done with functional programming. Also, putting the disconnection in the __destructor might be easier to read in the code logic as you could simply delete the object. I don't like the die() in the method, either. .A better implementation would be to have objects for different tables inheriting from a base (possibly abstract) object or interface. The child obs would specialise their behaviour and properties.
jacksawild 1 year ago
its a nice one for the beginners.. however, you can make it way better with some constructors/destrucors and, interface and static methods. futhermore, there is no reason to leave all the objects public
benyitzhaki 1 year ago
Cute, but not efficiant.
private Driver, protected Connector extends Driver. public API extends Connector.
If you can look throgh thism u have saves you a hole lot of time an money.
(Driver handles DB and __construct. Connector handles DB-calls. API handles application and thereby I/O. !Is instantitated!)
daniel1982 1 year ago
OMG this code is beautiful! Thank you
yendor79 1 year ago
I´ve Tested, Realy works! Thanks for help me!
paixaosantiago 2 years ago
please show some examples to insert data and select data from a table
crohole 2 years ago
@crohole
var $insert
$this->insert = mysql_query("INSERT INTO table (id,username,etc,etc) VALUE ($username,etc);
Try something similar to that.
W4iCorky 1 year ago
@W4iCorky Mty bad, I missed a few things out like ") lol
W4iCorky 1 year ago
tes
crohole 2 years ago
Thanks. Can I know, which editor you used?
parthatr 2 years ago
not bad
I wish there was a language that combined the simplicity elegance and power of perl and the modern web functionality of PHP
i guess its one or the other :(
tuleo554 2 years ago
Im so excited about OOP!
Thank you so much!
Petterss22 2 years ago
$comment = new youtube;
$comment->post('Object oriented programming is awesome..
Never looking back to procedural.');
imperialcrypt 2 years ago
you include the php class file then use $database->functionname , the $database-> but whatever you named your instance is what youll use if that makes sense?
so like new to create a new instance of the class database you'd do $whatuwannacallithere = new Database() ;[new database cos thats the name of the class] then you include it into the file and do $nameyoucalled it->function_you_want
KevzJD 2 years ago 2
Nice vid.
Can you explain why you have "if(!$res) { die(mysql_error()); }" in it's own function conf_query(), instead of having it in the query() function?
kryps1 2 years ago 2
thanks BMCVET :)
kdottz 2 years ago
Hello friend;
I would like to thank you for this tutorial by this huge lack of OOP that made the people who do not yet understand the use of classes. I am speaking particularly for little or no experience in OOP and videos like this really makes a huge difference to who is to begin programming in OOP.
Thank you my friend!!
BMCVET 2 years ago
Eclipse For PHP :)
and thanks for the comment hehe
kdottz 2 years ago
Hey kdottz :)
I think this is the best Audio less OO PHP Tutorial here in youtube, so please can you make more of these type of tutorials.
For Example:
1. Private Messaging Class
2. Friend Invite Class
3. Send E-mail Class
4. User comment Class
5 and just many others you can think of Bro :)
and Tell Me if you have any where else i can view your tutorials :)
tholithemba 2 years ago
Awesome tutorial, saved me a lot of work redoing all time, OOP rocks!
What editor are you using?
jaimievansanten2 2 years ago
Nice, just what I needed.
modernclics 2 years ago