MySQL ???????? BLOB ??? ??
???? MySQL ?????? ???? ???? ??? 5?? BLOB ???? ???? ? ??? ???????. "???"?? ??? ?????. PHP ? ?????? ??? ????? ? ??? ??? ?? ? ????. ?? ??? ??? ??? ?????.
MySQL? ??? ??
??????? ???? ???? ??? ???? ? ????. ???? ??? ???? ???? ???? file_get_contents()? ???? ?? ??? ????????lashes()? ?????. ?? ?? ? ???? ??? ?? ? ??? ?? "store" ???? ?????.
??? 5? ??? ??
?? ???? 5? ???? ?????, ??? ?? MySQL ??? ??? ? ????.
<code class="sql">SELECT id, image FROM store ORDER BY id DESC LIMIT 5</code>
? ??? ??? id ?? ?????? ???? ??? ??? 5? ???? ????? ?????.
???
????? ???? ????? ?? PHP ??? ??? ? ????.
<code class="php">$result = mysqli_query($db, $sql); // Execute the SQL query while ($row = mysqli_fetch_assoc($result)) { // Iterate over the result rows echo "<img src='get.php?id=" . $row['id'] . "' />"; // Display the image using the `get.php` script }</code>
? ??? while ??? ???? ?? ?? ???? ? ?? img ??? ?????. ??? ??? ???????? ?? ??? ???? ???? ??? PHP ????? get.php? ?????.
get.php ????
get.php ????? ??? ??? ???.
<code class="php">$id = addslashes($_GET['id']); // Get the image ID from the URL $image = mysqli_query($db, "SELECT image FROM store WHERE id=$id"); // Fetch the image data $image = mysqli_fetch_assoc($image); // Retrieve the image data as an array header("Content-type: image/jpeg"); // Set the content type for the image echo $image['image']; // Output the binary image data</code>
? ????? ??? ID? ?? ??? ???? ???? ??? MIME ???? ???? ????? ???? ???? ? ??? ???.
??
? ??? ??? PHP? MySQL ??????? ???? ??? 5?? ??? ???? ????? ??? ? ????. ??? ? ? ??? ?? SQL ??? PHP ??? ???? ?? ??? ??? ??? ???? ?? ??? ?? ??? ????? ?? ?????.
? ??? PHP?? MySQL ??????? ??? 5? BLOB ???? ???? ??? ??????? ?? ?????. ??? ??? 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?? NULL ?? ?? ? ? 1. ???? ?? ? ? ? ??? NotNull? ???? ?? ??? NULL? ?????. 2. iSnull ?? ISNOTNULL = ??! =; 3. Ifnull ?? Coalesce ??? ????? ???? ???? ? ??? ? ????. 4. ?? ?? ????? NULL ?? ?? ??? ?? ???? ??? ?? ? ORM ??? ?? ?? ?????? ??????. NULL? ???? ?? ?? ???? ??? ???? ?? ?? ?? ????. ??? ???? ??, ?? ? ???? ?? ? ??? ?? ??? ??? ?? ???????. ??? ??? ???? ??? ?? ?? ??? ????? ?? ? ????.

MySQLDump? MySQL ??????? ??? ??? ???? ???? ?????. ??????? ???? ?? ?? ? ?? ?? ???? SQL ??? ?????. 1. ?? ??? ????? ??? ?????? ??? ???? ??? SQL ???? ?????. 2. ??? ?????? ?? ??? ??? ???? TB ?? ???? ?? ???? ???? ????. 3. ???? ???-single transaction,-databases,-all-databases,-routines ?; 4. MySQL ??? ???? ?? ?? ?? ?? ?? ? ??? ?? ??? ???? ? ????. 5. ??? ????? ????? ?? ? ?? ??? ???? ?? ????.

MySQL ?????? ? ???? ??? ??? information_schema? ?? ????? ?? ? ??? ??? ? ????. 1. ?? ?????? ?? ?? : SQL ?? ???? selecttable_schemaas'database ', sum (data_length index_length)/1024/1024as'size (mb) 'frominformation_schema.tablessgroupbytable_schema; ?? ??????? ? ??? ??? ?? ??????? ???? ??? ?? ? ? ????. 2. ?? ??? ??? ?????? : selectta? ??????

?? ?? ? ?? ?? ??? ??? ??? ?????? ?? ??? ??? ?????? ??? ?????? ?????? ??? ?????. ? ?? ?? ???? ????. ??, ??????, ??? ? ??? ?? ??? UTF8MB4? ???? ???? ShowCreatedAtabase/Table? ???? ? Alter ??? ??????. ??, ?????? ??? ? UTF8MB4 ?? ??? ???? ?? ?? ??? ????? SetNames? ??????. ??, ?? ??? ????? ???? UTF8MB4_UNICODE_CI? ???? ?? ? ????? ???? ???? ?????? ???? ?? ? ? ?? ?? ??? ????? ??????.

GroupBy? ???? ???? ????? ?? ??? ???? ? ???? ??? ? ??? ????? ? ?????. ?? ??, GroupByCustomer_ID? ???? ? ??? ? ???? ??? ? ????. ???? ? 1,000 ? ??? ? ??? ??? ?? ? ? ????. ?? ? ? ?? ??? GroupBy? ??????, ?? ?? ?? ???? ???? ??? ??? ? ? ????. ???? ???? ? ??? ? ??, ?? ?? ??? ? ?? ???? ???? ?????.

MySQL? ???? ??? ???? InnoDB ?? ??? ???? ??? ???? ???? ?????. 1. ????? ??? SQL ?? ????, ?? ?? ?? ?? ??? ?????. 2. ? ???? ???, ???, ?? ? ???? ?????. 3. ????? ???? ????? ??? STARTTRANSACTION, CONMING ? ROLLBACK???. 4. 4 ?? ?? ???? ?? ??, ?? ? ??, ?? ??? ?? ? ???? ?????. 5. ????? ???? ???? ?? ??? ??? ?? ??? ?? ?? ? ??? ????? ??????. ??? ????? ?? MySQL? ?? ???? ?? ??? ?? ? ? ????.

MySQL ??????? ???? ?? ???? ??? ?? ? ?????? ???? ????. ?? MySQL -U ??? ?? -P? ???? ????? ???? ???? ??? ?????? ??????. ?? ??????? ???? ?? ??? ??? ????? -h ?? ??? ???????. ??, mysql-u username-p database name ?? mysql-u username-p database name? ?? ??? ? ? ?? ??????? ?? ????? ??? ? ? SQL ??? ??? ? ????.

MySQL? ?? ?? ? ???? ?? ??? ??? ??, ?? ?? ? ???? ??? ??? ? ?????. ??, ??? ??? UTF8MB4? ?? ?? ??? ?? ??? ?????. ?? ??? UTF8MB4_UNICODE_CI? ?? ?? ?? ??? ???? UTF8MB4_BIN? ?? ?????. ??, ?? ??? ?? ??? ??, ??????, ??? ? ??? ??? ? ????. ??? ??? ?? UTF8MB4 ? UTF8MB4_UNICODE_CI? ?? ? ???? ???? ?? ????. ??, ?? ??? ?? ??? ?? ???? ?? ??, ?? ?? ???? ??? ??? ?? ???? ???? ??? ???? ???? ???????. ?? ?? ??? ???? ?? ???? ? ??? ? ?? ??? ???????.
