一個對數(shù)據(jù)庫進行操作的程序
Jun 08, 2016 pm 05:33 PMdb.func:
function GetRows( $Database, $Query ) {
mysql_connect ("ftp", "root", "");
$db = mysql_select_db( $Database );
if ( ! $db ) {
echo "無法連結(jié)數(shù)據(jù)庫!";
exit;
}
$rows = mysql_query( $Query );
if ( ! $rows ) {
echo "SQL指令錯誤!";
exit;
}
return $rows;
}
function ConnectDatabase( $Database ) {
mysql_connect ("ftp", "root", "");
$db = mysql_select_db( $Database );
if ( ! $db ) {
echo "無法連結(jié)數(shù)據(jù)庫!";
exit;
}
}
?>
cratetable.php:
function CreateTable() {
$link = mysql_connect ("ftp", "root", "");
$db = mysql_select_db("pcadmin");
if ( ! $db ) {
echo "連接到數(shù)據(jù)庫失?。?;
exit;
}
$rows = mysql_query("select * from Profile");
if ( ! $rows ) {
$sql = "Create Table Profile (ID integer auto_increment primary key,Name char(255),Produce char(255),Lianluo char(255),Tel integer(15),Email char(255))";
mysql_query($sql);
}
$rows = mysql_query("select * from Aplication");
if ( ! $rows ) {
$sql = "Create Table Aplication(Name char(255) primary key,IP char(255),Ap char(255),Directory char(255))";
mysql_query($sql);
}
mysql_close ($link);
}
CreateTable();
?>
input.htm:

? 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? ?? ????? ?????? ?? ??? ?????. 1. MySQL ?? ??, sudosystemctlstopmysql ?? sudosystemctlstopmysqld? ??????. 2. -skip-grant-tables ???? mysql? ???? sudomysqld-skip-grant-tables &; 3. MySQL? ????? ?? SQL ??? ???? FlushPrivileges; Alteruser'Root '@'localHost'IndifiedBy'Your_new? ?? ??? ?? ????? ??????.

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 ??? ?? ??? ?? ?? ??? ?? ??? ??????. 1. ?? ?? ?? ?? ???? Slow_Query_Log ? Long_Query_Time; 2. ???? ??? ?? ??? ???? ? ????? query_time, lock_time, rows_examined? ?? ?? ??? ???? ????. 3. ??? ????? ???? ?? mysqldumpslow ?? pt-query idigest ??? ??????. 4. ??? ???? ??? ??, ??*???*, ??? ?? ?? ?? ?????. ?? ??, user_id? ???? ???? ?? ? ?? ?? ?? ??? ?? ???? ???? ? ????.

TOSECIBERYNECTTOEREMOTEMYSQLSERVER, USESSHTUNNENG, CONFIGUREMYSQLFORREMOTEACCESS, SETFIREWALLRULES ? CONSIDERSSLENCRYPTION .First, SpectionANSSHTUNNELWITHSSH-L3307 : LocalHost : 3306user@remote-Server-NandConnectViamySQL-H127.0.1-P3307.second, editmys

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

MySQL ???? ? ?? ????? ?? ?? ? ?? ??? ?????. 1. ????? ??? ?? ? ??? ?? ?? ?? ? ??? ??? ?? ?? ??? ?? ??? ?? ??????. 2. ?? ???? ?? ?? ? ?? ?? ??, ?? ... ForupDate Plus X Locks, Select ... LockinShareMode Plus S Locks, Write Operations Automally Locks ? Indexs? ?? ???? ??? ?? ???????. 3. ?? ??? ????? ????? ?? ? ??? ???? ????? ???? ??? ???????. 4. ?? ?? ??? showengineinnodbstatus ??? ?? ?? ?? ??? ?? ??? ?? ? ? ??? ??? ???? ?? ?? ??, ??? ?? ? ? ???? ???? ?? ?????.

MySQL ???? ????? Limit and Offset? ???? ????? ??? ??? ?? ??? ?? ????. 1. ?? ? ???? ?? ????, ???? ?? ??? ????, ??? limitnoffsetm???. 2. ?? ??? ??? ???? ??? ??? ???? ???? ??? ????. 3. ??? ???? ?? ???, ??? ??? ? ??? ?? ??? ?????. 4. ?? ???? ?? ???? ??? ???? ?? ? ?? ?? ?? ???? ???? ????. ???? ?????. "?? ???"??? ???? ??? ??? ???? ????.
