DB duomenų tipai

CHAR(<simbolių_kiekis>)

DB visada užima nurodytą simbolių kiekį, nesvarbu ar tai būtų tarpas ar skaičius, ar raidė.

pvz.:

CHAR(4), 4 baitai visada

'' = 4 baitai = '____';

'ab' = 4 baitai = 'ab__';

'abcd' = 4 baitai = 'abcd';

'abcdef' = 4 baitai = 'abcd';


VARCHAR(<simbolių_kiekis>)

DB užima vienu baitu daugiau, kurį naudoja užimamų simbolių kiekiui nurodyti

VARCHAR(4), kintamas dydis

'_' = 1 baitas = '';

'ab' = 3 baitai = 'ab';

'abcd' = 5 baitai = 'abcd';

GRASP - General Responsibility Assignment Software Patterns

Skirstymas pagal atsakomybes.


  • Information Expert
  • Creator
  • Controller
  • Low Coupling
  • High Cohesion
  • Polymorphism
  • Pure Fabrication
  • Indirection
  • Protected Variations

github.com/domnikl/DesignPatternsPHP - ( designpatternsphp.readthedocs.io/en/latest/ )

Falsy and Truthy - PHP

When converting to boolean, the following values are considered FALSE:

  • the boolean FALSE itself
  • the integers 0 and -0 (zero)
  • the floats 0.0 and -0.0 (zero)
  • the empty string, and the string "0"
  • an array with zero elements
  • the special type NULL (including unset variables)

Every other value is considered TRUE (including any resource and NAN).

Warning:

-1 is considered TRUE, like any other non-zero (whether negative or positive) number!

scroll to content top