Загрузка...

Advance Practical PHP Explain OOP with simple DB Connection - video 93

The Object-oriented programming (OOP) is a programming paradigm based on the concept of objects. And the objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods).

So far I have been showing you guys the procedural programming. Writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods.

Again, Object-oriented programming has several advantages over procedural programming:

- OOP is faster and easier to execute
- OOP provides a clear structure for the programs
- OOP helps to keep the PHP code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug
- OOP makes it possible to create full reusable applications with less code and shorter development time.

PDO::ATTR_ERRMODE attribute controls how PDO should behave on errors.

PDO::ERRMODE_SILENT (default): PDO will not raise warnings or throw exceptions in case of an error.

It is up to the caller to inspect PDO::errorCode() and PDO::errorInfo() methods on both statement and PDO objects to determine errors.

PDO::ERRMODE_WARNING: Emits a warning (E_WARNING) in addition to setting the error code and information.

PDO::ERRMODE_EXCEPTION: Throws a PDOException in case of an error.

And there’s another one called ‘PDO::ATTR_EMULATE_PREPARES.’
Setting PDO::ATTR_EMULATE_PREPARES to true can bypass some restrictions in SQL Server.

Again, for each connection PDO makes to a database, it supports an attribute to specify how PDO should behave when an error occurs with the query, connection, or the database. PDO::ATTR_ERRMODE attribute controls how PDO should behave on errors.

Here are the html/scripts in an txt and php extension.

——————————————————-
——————————————————-

https://convertowordpress.com/oOPDBConnection.php
https://convertowordpress.com/oOPDBConnection.txt

——————————————————-
——————————————————-

Check out the PHP manual that is available online:

https://www.php.net/docs.php

If you want a developer to create your web design project.

Visit: https://convertowordpress.com

Видео Advance Practical PHP Explain OOP with simple DB Connection - video 93 канала OldManPHP
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять