Слайды и текст доклада
Pic.1
OOP PHP CLASS object function_construct
Pic.2
object object $cat=new mammal(“кошка”); property echo $cat->name; method $cat->move (4);
Pic.3
<?php <?php class mammal { public $blood, $legs; public function __construct($name) { $this->name = $name; $this ->blood="теплая"; echo “Construction class of mammal have …
Pic.4
Destructor Destructor function_destruct() unset() <?php class mammal { public $blood, $legs; public function __construct($name) { $this->name = $name; $this ->blood="теплая"; echo …
Pic.5
Nested (enclosed) objects Nested (enclosed) objects <?php class Room { public $name;\ function __construct($name="безымянная") { $this->name = $name; } } class House { public $room; } …
Pic.6
Copying of objects Copying of objects <?php class simple_mammal { public $legs; } $cat = new simple_mammal; $cat -> legs = 4; $whale = $cat; $whale -> legs = 0; echo $cat -> legs; echo …
Pic.7
Cloning of objects Cloning of objects <?php class mammal { public $legs; } $cat = new mammal; $cat -> legs = 4; $whale = clone $cat; $whale -> legs = 0; echo $cat -> legs; echo $whale …
Pic.8
class inheritance <?php class mammal{} class beast extends mammal { public $fur; function __construct($name) { parent::__construct($name); echo "запущен конструктор класса beast "; } …
Pic.9
FINAL class <?php class mammal { public $blood, $legs; public function __construct($name) { $this->name = $name; $this ->blood="теплая"; echo "Запущен конструктор класса …
Pic.10
class beast extends mammal class beast extends mammal { public $fur; function __construct($name) { parent::__construct($name); echo "запущен конструктор класса beast "; } function …
Pic.11
function description() function description() { $this->fur="мягкая и пушистая"; echo $this->name," ",$this->fur," . "; echo "Кровь - ", …
Pic.12
<?php <?php define('USERNAME', "user45"); define('PASSWORD', "pass45"); define('DBNAME', "taxi"); define('SERVER', …
Pic.13
$query = "SELECT model, madein, reg_number FROM cars"; $query = "SELECT model, madein, reg_number FROM cars"; $result=mysqli_query($link,$query); if ($result) { $rows = …
Pic.14
for ($i=0; $i<$rows; $i++) for ($i=0; $i<$rows; $i++) { $r=mysqli_fetch_assoc($result); echo "<tr><td>". $r["model"]. "</td>"; echo …
Pic.15
<?php $mysqli = new mysqli('localhost', 'root', 'secret', 'firma'); if (mysqli_connect_errno()) { printf("Подключение невозможно: %s\n", …
Pic.16
$query = "SELECT name, description FROM cities LIMIT 5"; if ($result = $mysqli->query($query)) { while ($row = $result->fetch_row()) { printf ("%s (%s)\n", $row[0], …
Pic.17
<?php $mysqli = new mysqli('localhost', 'root', 'secret', 'firma'); if (mysqli_connect_errno()) { printf("Подключение невозможно: %s\n", …
Pic.18
$stmt = $mysqli->prepare("INSERT INTO countries VALUES (?, ?)"); $stmt->bind_param('ss', $name, $description); $name = 'Portugal'; $description = 'The country …
Pic.19
Classes: 1) mysqli 2)mysqli-result 3)mysqli-stmt Properties: 4)num_rows 5)affected_rows
Pic.20
Methods: 6)fetch_array(MYSQLI_ASSOC) 7)fetch_array(MYSQLI_NUM) 8)fetch_assoc() 9)fetch_row() 10)prepare() 11)query() 12)bind-param()
Pic.21
Objects: $mysqli object of mysqli $result object of mysqli-result $stmt object of mysqli-stmt Examples: echo $result->num_rows; $result->fetch_assoc();
Скачать презентацию
Если вам понравился сайт и размещенные на нем материалы, пожалуйста, не забывайте поделиться этой страничкой в социальных сетях и с друзьями! Спасибо!