tests
This commit is contained in:
parent
d68f9b232a
commit
642fb82938
@ -64,6 +64,11 @@ class Item
|
|||||||
public $mfuvorot;
|
public $mfuvorot;
|
||||||
public $mfauvorot;
|
public $mfauvorot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Item constructor.
|
||||||
|
*
|
||||||
|
* @param $row
|
||||||
|
*/
|
||||||
public function __construct($row)
|
public function __construct($row)
|
||||||
{
|
{
|
||||||
$this->name = $row['name'];
|
$this->name = $row['name'];
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
class ItemClass extends Item
|
class ItemClass extends Item
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public function printItemStats()
|
public function printItemStats()
|
||||||
{
|
{
|
||||||
echo $this->name ." (Масса: ". $this->massa .")<br>";
|
echo $this->name ." (Масса: ". $this->massa .")<br>";
|
||||||
|
2
test.php
2
test.php
@ -17,7 +17,7 @@ require_once 'config.php';
|
|||||||
$result = db::c()->query('SELECT * FROM `shop` WHERE count > 0');
|
$result = db::c()->query('SELECT * FROM `shop` WHERE count > 0');
|
||||||
|
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
$iteminfo[] = new Item($row);
|
$iteminfo[] = new ItemClass($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($iteminfo as $iinfo) {
|
foreach ($iteminfo as $iinfo) {
|
||||||
|
Loading…
Reference in New Issue
Block a user