JOIN? ??? CakePHP ?? ???
??? ?????? ??? ???? ?? CakePHP? ??? ?? ??? ???? find ???? ?????. ???? ?? ? ??? JOIN ??? ???? ?? ????? ???? ???? ????.
?? CakePHP ?? ??
CakePHP 2.x? ??? ???? ???? ???? ??? ??? ?????. ?? ??? ??. hasMany? presentsTo? ?? ?? ? ??? ???? ?? ??? ?? ?? ???? ???? ??? ? ????.
?? ?? ??? ??? ??? ??? ??? ??? ?????. message.from ??? users.id ??? ?????. ??? ???? ???? ???? ?? ??? ??? ????? ?? ??? ????.
- ??? ?? ??:
class User extends AppModel { public $actsAs = array('Containable'); public $hasMany = array('Message'); } class Message extends AppModel { public $actsAs = array('Containable'); public $belongsTo = array('User'); }
- ??? ?? .from ??? ?? ??? ?? message.user_id?.
- ???? ??? ?????. MessagesController:
$this->Message->find('all', array( 'contain' => array('User'), 'conditions' => array( 'Message.to' => 4 ), 'order' => 'Message.datetime DESC' ));
??? ?? JOIN ??
?? ?? ??? ???? ??? ?? ??? ??? ? ????:
$this->Message->find('all', array( 'joins' => array( array( 'table' => 'users', 'alias' => 'UserJoin', 'type' => 'INNER', 'conditions' => array( 'UserJoin.id = Message.from' ) ) ), 'conditions' => array( 'Message.to' => 4 ), 'fields' => array('UserJoin.*', 'Message.*'), 'order' => 'Message.datetime DESC' ));
?? ??? ???? ?? ??
?? ???? ??? ??? ?? ?? ??? ???? ?? ?? ????. ?? ??? ????.
class User extends AppModel { public $actsAs = array('Containable'); public $hasMany = array( 'MessagesSent' => array( 'className' => 'Message', 'foreignKey' => 'from' ) ); public $hasBelongsTo = array( 'MessagesReceived' => array( 'className' => 'Message', 'foreignKey' => 'to' ) ); }
? ??? ???? ?? ??? ??? ? ????.
$this->Message->find('all', array( 'contain' => array('UserFrom'), 'conditions' => array( 'Message.to' => 4 ), 'order' => 'Message.datetime DESC' ));
? ??? CakePHP? Find ???? JOIN ??? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











MySQL? ?? ??? ??? ????? '??'??? ????? ?? ??? ?? ????. ?? Linux ???? ?? ??? Auth_Socket ????? ?? ?? ? ? ??? ??? ??? ? ? ????. Windows?? XAMPP ?? WAMP? ?? ??? ??? ? ?? ???? ????? ????? ??? Root, MySQL ?? ?? ???? ??? ?????. ????? ?? ?? ??, ????? -skip-grant-tables ???? ???? MySQL ???? ???? MySQL.user ???? ?????? ? ????? ???? ???? ?? ???? ????? ??? ? ? ????. MySQL8.0 ???? ?? ?? ????? ?????.

GTID (Global Transaction Identifier)? ? ????? ?? ? ??? ???? MySQL ???????? ?? ? ?? ??? ???? ?????. 1. ?? ??? ????? ?? ?? ? ??? ???? ???? ???? ??? ????? ?? ? GTID? ???? ????? ??? ? ????. 2. ?? ?? ???? ???? ? ????? ? ???? ? ?? ??????? ??? ???? ?????. 3. ?? ?? ???? ??????. GTID?? ?? UUID ? ?? ??? ???? ??? ???? ??? ???? ? ???? ??? ???? ????. ? ? ?? ?? ??? MySQL ????? ???? ???? ???? ??? ???? ??? ???? ?? ??????.

MySQL ?? ????? ?? ???? ?? 4 ??? ?????. 1. ?? ?? : ????? ? ????? ????, ?? ?? ? ??? ??? ????? ???? ?? ???? ??? ???? ?? ??? ??? ?? ? ?? ????? ???? MHA, ???????? ?? ??? ??? ? ??? ??? ??? ? ????. 2. ? ?? ?????? ?????? : ??? ??? ?? ?? (Seconds_Behind_master), Binlog ??? ???, ???? ?? ??? ??? ?? ?? ??? ???? ?????? ???? ??? ?? ??? ?? ?? ?? ??? ??????. 3. Switch Topology : ?? ???? ?????? ??? ??? ?????? ???, ?? ???? ????? GTID? ????? VIP, DNS ?? ??? ??? ????????.

mysqlroot ??? ????? ????? ????? ? ?? ??? ????. 1. Alteruser ??? ???? ?? ??? ???? ??? ? ? ?? ?? ??????. 2. ????? ?? ??? ???? ???? ???? ?? -skip-grant-tables ???? ???????. 3. mysqladmin ??? ???? ???? ?? ??? ? ????. ? ??? ?? ????? ???? ?? ???? ???? ??? ??????. ??? ??? ??? ??????? ?? ?????? ???????.

MySQL ??????? ???? ??? ??? ????. 1. ?? ?? ??? ???? MySQL-U ??? ?? -P-H ??? ??? ????? ??? ??? ????? ???? ???????. 2. ??? ??????? ?? ?? ???? ?? MySQL-Uroot-PmyProject? ?? ?? ? ?????? ??? ?? ? ? ????. 3. ??? ?? 3306? ?? ?? MySQL-Uroot-P-H192.168.1.100-P3307? ?? ?? ??? ????? -p ?? ??? ???????. ?? ???? ??? ???? ?? ?? ? ? ????. ??? ???? ????, ??? ?? ?? ??? ??????. ?????? ?? ? ?? ??? ???? ?? Linux? MySQL-Client? ??? ? ????. ? ??? ???????

InnoDB? MVCC ? GAP ??? ?? ?? ??? ??? ?????. MVCC? ?? ?? ?? ??? ??? ???? ?? ?? ??? ?? ?? ???? ??? ???? ?????. ? ??? ?? ????? ???? ???? ?? ???? ?? ??? ????. ?? ??, ????? ? ?? ??? 100? ?? ?? ???? B? 200?? ???? ???? A? ??? ???? 100???. ?? ??? ?? ? ? Gap Lock? ?? ????? ??? ??? ?????. ?? ? ?? ??? ??? ????? ? ??? ?? ? ? ??? ?? ? ?? ?? ??? ?? ??? ???? ?? ? ??? ?? ?? ?? ?? ? ?? ??? ????? ? ??? ?? ? ? ????.

ToalteralArgeProductionWithoutLongLocks, useOnlinedDlTeChniques.1) ?? evidentifyOURalterOperationISFast (? : ??/?? ?? ??, modifyingnull/notnull) OrsLow (? : ?? ??, ?? ??, ???, ???) .2) .2) .2)

INdexESINMYSQLIMPROVEQUERYPEEDBYENABLEABERDATARETRIVEAL.1. THEYREDUCEDASCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCANCEND, WHERREORORDERBANTROWESINTROWSES, ?? ?? ??? ???? ?????
