PDO? ???? PHP?? MySQL ?? ???? ?? ??
??:
LAST_INSERT_ID() ?? ???? ?? PHP ? PDO? ???? MySQL ?? ???????
????:
?? PHP ??? ?????.
<?php $stmt = $db->prepare("CALL simpleProcedure(:name,:returnid)"); $stmt->bindValue(':name', $name, PDO::PARAM_STR); $stmt->bindParam(':returnid', $returnid, PDO::PARAM_INT, 11); $stmt->execute(); echo $returnid; ?>
? ??? ????? ????. PDO? ?? ??? ?? ???? ????.
???:
MySQL ?????? ??? ????? ?? ??? ????.
1??: ???? ??
??? ???? ????? ???? ??? ??? MySQL ??? ?????. ?:
<?php $stmt = $db->prepare("CALL simpleProcedure(:name, @returnid)"); $stmt->bindValue(':name', $name, PDO::PARAM_STR); $stmt->execute(); ?>
2??: MySQL ?? ??
??? ??? ???? MySQL ??? ?????.
<?php $stmt = $db->query("SELECT @returnid"); $result = $stmt->fetchAll(PDO::FETCH_COLUMN, 0); $returnid = $result[0]; ?>
?:
?? ???? ??? ???? ??(IN, INOUT, OUT)? ?? ?? ??? ???? ?? ??? ?? ???? ????.
SQL ???? :
CREATE PROCEDURE `demoSpInOutSqlVars`( IN pInput_Param INT, /* --- */ INOUT pInOut_Param INT, OUT pOut_Param INT) BEGIN /* * Pass the full names of SQL User Variable for these parameters. e.g. '@varInOutParam' * These 'SQL user variables names' are the variables that Mysql will use for: * 1) finding values * 2) storing results * * It is similar to 'variable variables' in PHP. */ SET pInOut_Param := ABS(pInput_Param) + ABS(pInOut_Param); SET pOut_Param := ABS(pInput_Param) * -3; END$$
PHP ??:
<?php // Bind PHP variables $phpInParam = 5; $phpInOutParam = 404; $phpOutParam = null; // Prepare the SQL procedure call $sql = "call demoSpInOut(:phpInParam, @varInOutParam, @varOutParam)"; $stmt = $db->prepare($sql); $stmt->bindParam(':phpInParam', $phpInParam, PDO::PARAM_INT); // Set the SQL User INOUT variables $db->exec("SET @varInOutParam = $phpInOutParam"); // Execute the procedure $stmt->execute(); // Get the SQL variables into PHP variables $sql = "SELECT @varInOutParam AS phpInOutParam, @varOutParam AS phpOutParam FROM dual"; $results = $db->query($sql)->fetchAll(PDO::FETCH_ASSOC); $phpInOutParam = $results[0]['phpInOutParam']; $phpOutParam = $results[0]['phpOutParam']; // Display the PHP variables echo "phpInParam: $phpInParam<br>"; echo "phpInOutParam: $phpInOutParam<br>"; echo "phpOutParam: $phpOutParam<br>"; ?>
? ??? ??? PDO? ???? MySQL ?? ????? ??? ????? ??? ? ????.
? ??? PHP?? PDO? ???? MySQL ?? ?????? ??? ???? ??? ??????? ?? ?????. ??? ??? 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)

??? ??











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 ?? ??? ??? ????????.

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? MySQL? ?? ?? ?????. ???, ??? ?? ? ?? ?? ???? MyISAM? ?? ?? ??? ???? ?????. 1. ???? ??? ????, ? ??? ???, ??? ???? ????, ?? ?? ?? ??? ??? ?? ?? ??? ????? ?????. 2. ?? ?? ?? ???? ??? ???? ???? ?? ??? ???? ?? ?? ?? ?? ?? ??? ?????. 3. ?? ?? ????? ?? ?? ??? ??? ??? ???? ?? ???? ???? ?? ? ??? ? ??? ???? ???? ?? ?? ?? ?? ??? ?????.

MySQL? ?? ???? ?? ??? ??? ? A??, ?? MVCC ? GAP ?? ??? ?? ??? ?? ? ?? ???? ??? ???? ???? ?? ?? ??? ????. ?? ?? ??? ??? ?? (??)? ????? ??? ??? ????? ?? ?? ??? ????? 1. ??? ??? (read committed)? ?? ? ???? ?? ? ??? ?? ? ??? ?? ? ?? ?? ?? ?? ? ? ????. ???, ??? ??? ????? ??? ??;

MySQL ????? ?? ??? ?? ?????? ????? ???? ???? ?????. ??, ???? ??? ???? ??? ????? ?????. ?? ?? ?? ?? ??? ?????. ?? ??, ?? ? ??? ?? ???? ??? ????? ??? ???? ??????. ??, ???? ????? ??????? ? ??? ???? ?? ??? ?? ? ? ????? ?? ?? ? ???? ?? ????? ?? ??? ??? ??? ?????. ??, ??? ?? ??? ?? ??? ???? ????, ??? ??, ?? ???? ?? ? ??? ??? ?????. MySQL? readuncommitted ? readcommi? ?????.

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

MySQL? ? ????? ??? ??? ????? ?? ?? ??? ?? ???????. 1. Windows ??? : MySQL ?? ?????? ? ??? ????? (?? ??? ????? C : \ programfiles \ mysql \ mysqlserverx.x \ bin), "? ???"→ "??"→ "Advanced System ??"→ "?? ??", "??? ??", MySQlb in wors in mysqlb in wors in mysqlb in world in that the the the the the seel worl ?? ????? ?? ???? MySQL? ??????-Version Versification; 2.Macos ? Linux ??? : Bash ??? ?? ~/.bashrc ?? ~/.bash_
