Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysqlÊý¾Ý¿âº¯Êý

²éѯÓï¾ä:
SELECT ×Ö¶ÎÃû from ±íÃû.
ÅÅÐò order by ÒªÅÅÐòµÄ×Ö¶ÎÃû desc :ÒÔµ¹Ðò²éѯ.
limit ´ÓµÚ¼¸¸ö¿ªÊ¼ ²éÕÒ¶àÉÙ¸ö :²éÕÒÖ¸¶¨¸öÊý.
ͬʱ²éѯ¶à¸ö×Ö¶ÎÓÃ","¸ô¿ª.
Èç²éѯ±íÀïÃæµÄËùÓÐÊý¾ÝÔÚ×Ö¶ÎÃû´¦Ìî"*".
ÈçÖ»ÏëÏÔʾij×ֶεÄÇ°¼¸Î»×Ö·û¿ÉÒÔʹÓÃLEFTº¯Êý.
SELECT ×Ö¶ÎÃû,LEFT(×Ö¶ÎÃû,λÊý),×Ö¶ÎÃû from ±íÃû.
COUNT :¼Ç¼×ÜÊýµÄº¯Êý(id)
AVG :ƽ¾ùÖµµÄº¯Êý.
MIN :×îСֵµÄº¯Êý.
MAX :×î´óÖµµÄº¯Êý.
SUM :ÇóºÍµÄº¯Êý.
WHERE :·µ»ØµÄ½á¹û½øÐÐÏÞÖÆ.
LIKE ¹Ø¼ü×Ö¸æËßMySQLÖ¸¶¨µÄ×Ö¶ÎÆ¥Åä¸ø¶¨µÄ±í´ïʽ,ÈçSELECT ×Ö¶ÎÃû from ±íÃû WHERE ×Ö¶ÎÃû LIKE "%ÒªÕÒµÄ×Ö%" AND ʱ¼ä>="2009-01-01" AND ʱ¼ä<"2009-02-01";
±íʾ:ÒªÕÒµÄ×Ö2Ô·ݵļǼ.
Á¬½ÓÊý¾Ý¿â:mysql -h host<Ö÷»ú> -u user<Óû§Ãû> -p enter password ******<ÃÜÂë>
ɾ³ýÓï¾ä:
DELETE from ±íÃû WHERE ×Ö¶ÎÃû LIKE "%ҪɾµÄ×Ö%"
DELETE from ±íÃû <½«»áÇå¿ÕÒ»¸ö±í>
¸üÐÂÓï¾ä:
UPDATE ±íÃû SET Òª¸üеÄÄÚÈÝ<date="2009-01-01"> WHERE ×Ö¶ÎÃû<ID="1"> LIKE "%×Ö¶ÎÄÚÈÝ%"
´´½¨Êý¾Ý¿â±í: CREATE TABLE ´´½¨±íµÄÃû³Æ.
²é¿´Ò»¸ö¸Õ½¨Á¢µÄ±íµÄÏêϸÐÅÏ¢µÄ·½·¨: DESCRIBE ¸Õ½¨Á¢µÄ±íµÄÃû³Æ.
µ¼³öÊý¾Ý¿âºÍ±í:
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû.
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû ±íÃû.
ÈçÒªµ¼³öÊý¾Ý¿âÀïÃæµÄÆäËüÊý¾Ý²Î¼ûÊé181Ò³.
²åÈëÊý¾Ý:
INSERT INTO ±íÃû (×Ö¶ÎÃû,×Ö¶ÎÃû......) values ("¶ÔÓ¦×Ö¶ÎÖµ","¶ÔÓ¦×Ö¶ÎÖµ"......)
Êý¾Ý¿â×Ö·û´®ÀàÐÍ:
char :¹Ì¶¨³¤¶ÈÀàÐÍ.
varchar :¿É±ä³¤¶ÈÀàÐÍ,³¤¶È+1.
Êý¾Ý¿âÈÕÆÚʱ¼äÀàÐÍ:
date :ÈÕÆÚÀàÐÍ.
time :ʱ¼äÀàÐÍ.
datetime :ÈÕÆÚʱ¼äÀàÐÍ.<Y-m-d H:m:s>
Êý¾Ý¿âÊý×ÖÀàÐÍ:
TINYINT :1×Ö½Ú 255
SMALLINT :2×Ö½Ú 65535
MEDIUMINT :3×Ö½Ú 16777215
INT :4×Ö½Ú 4294967295
BIGINT :8×Ö½Ú 18446744073709551615
session_unregister(Ҫɾ³ýµÄ±äÁ¿Ãû,Èç$_SESSION["..."]) ¿ÉÒÔɾ³ýij¸ö»á»°±äÁ¿,unset()º¯ÊýÔÚ´Ë´¦Óë´Ëº¯Êý×÷ÓõÈͬ.
session_destroy(ÎÞ) ½áÊøÄ¿Ç°µÄsession,±¾º¯ÊýûÓвÎÊý,ÇÒ·µ»ØֵΪtrue.
session_start(ÎÞ) ³õʼ»¯Ò»¸ö»á»°»òÊǼÌÐøÄ¿Ç°µÄ»á»°.
session_decode(Òª½âÂëµÄ×ÊÁÏ) ½âÃÜÒ»¸öʹÓÃsession_encode()¼ÓÃܵĵ±Ç°»á»°ÄÚÈÝ.
require(),require_once(),include(),include_once() µ÷ÓÃÍⲿÎļþµÄº¯Êý.
header("location:Ҫתµ½µÄµØÖ·") ÌøתÁ¬½Ó.
mysql


Ïà¹ØÎĵµ£º

ת MYSQLÖеÄmy.ini»òmy.cnfÅäÖÃ˵Ã÷

mysqld³ÌÐò--Ŀ¼ºÍÎļþ
basedir = path ʹÓøø¶¨Ä¿Â¼×÷Ϊ¸ùĿ¼(°²×°Ä¿Â¼)¡£
character-sets-dir = path ¸ø³ö´æ·Å×Å×Ö·û¼¯µÄĿ¼¡£
datadir = path ´Ó¸ø¶¨Ä¿Â¼¶ÁÈ¡Êý¾Ý¿âÎļþ¡£
pid-file = filename Ϊmysqld³ÌÐòÖ¸¶¨Ò»¸ö´æ·Å½ø³ÌIDµÄÎļþ(½öÊÊÓÃÓÚUNIX/Linuxϵͳ); Init-V½Å±¾ÐèҪʹÓÃÕâ¸öÎļþÀïµÄ½ø³ÌID½áÊømysqld½ø ......

MysqlµÄGROUP_CONCAT()º¯ÊýʹÓ÷½·¨ ¶àÐкϲ¢º¯Êý

GROUP_CONCAT ÊÇÒ»¸öºÏ²¢¶àÐеĺ¯Êý£¬Ò»°ãÓõÄÉÙ£¬ËùÒԺܶàÈ˶¼²»ÖªµÀ£¬ÎÒÒ²ÊÇÒ»¸ö£¬½ñÌìżȻ¿´µ½£¬¹Ê¼ÇÏ·½·¨£»
GROUP_CONCATµÄÓï·¨ÈçÏ£º
GROUP_CONCAT([DISTINCT] expr [,expr ...][ORDER BY {unsigned_integer | col_name | expr}[ASC | DESC] [,col_name ...]][SEPARATOR str_val])
ÏÂÃæÑÝʾһÏÂÕâ¸öº¯Êý£¬ÏȽ¨Á¢Ò ......

MySQL²éѯÓÅ»¯ Ë÷Òý

MySQLË÷Òý
    MySQL²éѯÓÅ»¯×îÖØÒªµÄµ±Êô½¨Á¢ÕýÈ·µÄË÷Òý£¬Ã»ÓÐË÷Òý£¬Ãæ¶Ôº£Á¿Êý¾Ý£¬Ò»ÇеÄÓÅ»¯´¿Êô¿Õ»°¡£Ê²Ã´ÊÇË÷Òý£¿Ë÷ÒýΪʲôÄÇôÖØÒªÄØ£¿ÕâЩÎÊÌâÕâÀï¾Í²»Ì¸ÁË£¬»¹ÊÇÏÈдÏÂÎÒÊ×´ÎÓÅ»¯MySQL²éѯº£Á¿Êý¾ÝµÄÐĵðɣ¬Êý¾Ý¿â±íÀàÐÍÊÇMyISAM¡£
    Èç¹û¼òµ¥µÄÒ»¸ö²éѯÓï¾ä£¬MySQL²éѯËٶȻ¹ ......

mysql Á¬½Óorcal Êý¾Ý¿â OCIDefineByName


Oracle 8 資ÁÏ庫º¯Ê½庫
OCIDefineByName
讓 SELECT Ö¸Áî¿ÉʹÓà PHP 變數¡£
語·¨: boolean OCIDefineByName(int stmt, string ColumnName, mixed &variable, int [type]);
傳»ØÖµ: ²¼ÁÖÖµ
º¯Ê½種類: 資ÁÏ庫¹¦ÄÜ
 
內È ......

MySQLÓÅ»¯×ܽá


±íÉè¼Æ·½Ã棺
1¡¢×Ö¶ÎÃû¾¡Á¿¼ò»¯£¬²»Òª³¬¹ý18¸ö×Ö·û
2¡¢Ê¹Óþ¡Á¿Ð¡µÄÊý¾ÝÀàÐÍ£¬ÀýÈ磺MEDIUMINT±ÈINTÉÙÕ¼ÓÃ25%¿Õ¼ä
3¡¢×Ö¶ÎÀàÐÍÓ¦¾¡Á¿±ÜÃâÉèÖóɿɱ䳤¶È£¬È磺VARCHAR¡¢BLOB¡¢TEXT
4¡¢ÓÃÓڱȽϵIJ»Í¬×ֶΣ¬Ó¦ÉèÖÃÏàͬµÄÀàÐͼ°³¤¶È
5¡¢¾¡¿ÉÄܽ«×Ö¶ÎÉùÃ÷ΪNOT NULL£¬²¢Ö¸¶¨DEFAULT
6¡¢Ö÷Ë÷Òý¾¡¿ÉÄܶÌ
7¡¢½ö´´½¨ÕæÕý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ