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

PHP²Ù×÷MySQLµÄº¯Êý

(1)mysql_connect(Ö÷»ú,Óû§Ãû,¿ÚÁî);
·µ»ØÒ»¸öÁ¬½ÓºÅ.
×¢Òâ:mysql¸÷Óû§µÄ¿ÚÁî¿ÉÒÔËæ¸ÃÓû§ËùÔÚ»úÆ÷IPµØÖ·²»Í¬¶ø¸Ä±ä. ÁíÍâ,mSQLûÓÐÓû§Ãû»úÖÆ,ËùÒÔmsql_connectÖ»ÐèÒªÒ»¸öÖ÷»ú²ÎÊý.Ö÷»ú¿ÉÒÔÊÇIPµØÖ·»òÓòÃû.
(2)mysql_create_db(Êý¾Ý¿âÃû);
(3)mysql_select_db(Êý¾Ý¿âÃû,Á¬½ÓºÅ);
Á¬½ÓÒ»¸öÊý¾Ý¿â.
(4)mysql_query(SQLÓï¾ä,Á¬½ÓºÅ);
Èç¹ûSQLÓï¾äÊÇselect,Ôò·µ»ØÒ»¸ö½á¹ûºÅ.·ñÔò·µ»ØµÄÖµ¿ÉÒÔ²»Àí»á. Èç¹ûʧ°Ü,·µ»Øfalse.
(5)mysql_fetch_array(½á¹ûºÅ);
È¡³öÏÂÒ»ÐÐ,·µ»ØÒ»¸öÊý×é.¿ÉÒÔÓÃÊý×Öϱê·ÃÎÊ(µÚÒ»¸ö×Ö¶ÎÊÇϱê0),Ò²¿ÉÒÔÓÃ×Ö·û´®Ï±ê·ÃÎÊ(¼´Ê¹Óø÷×Ö¶ÎÃû). ÈçÒÑÈ¡ÁË×îºóÒ»ÐÐ,·µ»Øfalse.
(6)mysql_fetch_field(½á¹ûºÅ,[×Ö¶ÎÐòºÅ]);
ÈçÎÞ×Ö¶ÎÐòºÅ,È¡ÏÂÒ»¸ö×Ö¶Î.·µ»ØÒ»¸ö¹þÏ£±í,ϱêÓÐ:
name,table,max_length,not_null,primary_key,unique_key,multiple_key,numeric,blob,type,unsigned,zerofill
¸÷ϱêµÄÒâ˼Ӧ¸Ã±È½ÏÃ÷°×ÁË.
(7)mysql_num_rows(½á¹ûºÅ);mysql_num_fields(½á¹ûºÅ);
(8)mysql_free_result(½á¹ûºÅ);
(9)mysql_list_dbs();mysql_list_tables(Êý¾Ý¿âÃû);
(10)mysql_close(Á¬½ÓºÅ);
(11)mysql_pconnect(Ö÷»ú,Óû§Ãû,¿ÚÁî);
(12)mysql_select_db(Êý¾Ý¿âÃû,Á¬½ÓºÅ);
Á¬½ÓÒ»¸öÊý¾Ý¿â.
Óëmysql_connectÍêÈ«ÏàËÆ,µ«½¨Á¢Ò»¸ö"ÓÀ¾ÃÁ¬½Ó",¸ÃÁ¬½ÓÒ»¾­½¨Á¢ÓÀ²»¹Ø±Õ,¼´Ê¹Ê¹ÓÃmysql_closeº¯Êý»ò³ÌÐòÖ´ÐÐÍê±ÏÒ²²»¹Ø±Õ.ÏÂÒ»´ÎÊÔͼ½¨Á¢ÓÀ¾ÃÁ¬½Óʱ,ϵͳÈç·¢ÏÖÒÑ´æÔÚÒ»¸öÓÀ¾ÃÁ¬½Ó,ÔòÖ±½Ó·µ»Ø¸ÃÁ¬½ÓºÅ¶ø²»ÖØд´½¨.
×¢Òâ:MySQL·ÃÎʺ¯Êý¶¼ÐèÒªÓÐÏàÓ¦µÄȨÏÞ²ÅÄÜÔËÐÐ


Ïà¹ØÎĵµ£º

hibernate mysql ²åÈëÖÐÎÄ´íÎó

 Ê¹ÓÃhibernate mysql ²åÈëÖÐÎÄ´íÎó£º
 Ô­ÒòÖ®Ò»ÊÇ£º
  mysql µÄ×Ö·û±àÂëºÍhibernate´«µÝµÄ±àÂë²»Ò»Ñù£¬
  ÀýÈ磺
  mysql ½¨¿âµÄʱºò¿ÉÒÔÉèÖñàÂë:
  CREATE DATABASE db DEFAULT CHARACTER SET utf8;
 hibernate Á¬½ÓmysqlµÄ±àÂ룺
 jdbc:mysql://127.0.0.1:3306/db?useU ......

ÔÚWindowsϵͳÉÏ°²×°PHPÓ¦ÓóÌÐò·þÎñÆ÷

תÌû£¬Ô­Îijö´¦ÈçÏ£º
http://web-developer.csdn.net/?p=161
°²×° PHP  Ó¦ÓóÌÐò·þÎñÆ÷ (Windows)
ÈôÒª´¦Àí¶¯Ì¬ Web Ò³£¬ÄúÐèÒªÓ¦ÓóÌÐò·þÎñÆ÷¡£Ó¦ÓóÌÐò·þÎñÆ÷ÊÇÒ»ÖÖÈí¼þ£¬Ëü°ïÖú Web ·þÎñÆ÷´¦Àí°üº¬·þÎñÆ÷¶Ë½Å±¾»ò±êÇ©µÄ Web
Ò³¡£µ±ä¯ÀÀÆ÷ÇëÇóÕâÑùÒ»¸öҳʱ£¬Web ·þÎñÆ÷ÏȽ«¸ÃÒ³´«µÝ¸øÓ¦ÓóÌÐò·þÎñÆ÷½øÐд¦Àí£¬È ......

ÈçºÎÔÚphpÖÐÐÞ²¹XSS©¶´

ÔÚPHPÖÐÐÞ²¹XSS©¶´£¬ÎÒÃÇ¿ÉÒÔʹÓÃÈý¸öPHPº¯Êý¡£
¡¡¡¡ÕâЩº¯ÊýÖ÷ÒªÓÃÓÚÇå³ýHTML±êÖ¾£¬ÕâÑù¾Íû°ì·¨×¢Èë´úÂëÁË¡£Ê¹Óøü¶àµÄº¯ÊýÊÇhtmlspecialchars() £¬Ëü¿ÉÒÔ½«ËùÓеÄ"<"Óë">"·ûºÅת»»³É"<" Óë">;"¡£ÆäËü¿É¹©Ñ¡ÔñµÄº¯Êý»¹ÓÐhtmlentities(), Ëü¿ÉÒÔÓÃÏàÓ¦µÄ×Ö·ûʵÌå(entities)Ìæ»»µôËùÓÐÏëÒªÌæ»»µôµÄÌØÕ÷Âë(cha ......

phpÖÐthis,self,parentÈý¸ö¹Ø¼ü×ÖÖ®¼äµÄÇø±ð

PHP5ÊÇÒ»¾ß±¸Á˴󲿷ÖÃæÏò¶ÔÏóÓïÑÔµÄÌØÐÔµÄÓïÑÔ,±ÈPHP4ÓÐÁ˺ܶàµÄÃæÏò¶ÔÏóµÄÌØÐÔ,µ«ÊÇÓв¿·Ö¸ÅÄîÒ²±È½ÏÄÑÒÔÀí½â,ÕâÀïÎÒÖ÷Ҫ̸µÄÊÇ this,self,parentÈý¸ö¹Ø¼ü×ÖÖ®¼äµÄÇø±ð¡£´Ó×ÖÃæÉϱȽϺÃÀí½â,·Ö±ðÊÇÖ¸Õâ¡¢×Ô¼º¡¢¸¸Çס£ÎÒÃÇÏȽ¨Á¢¼¸¸ö¸ÅÄî,ÕâÈý¸ö¹Ø¼ü×Ö·Ö±ðÊÇÓÃÔÚʲô µØ·½ÄØ?ÎÒÃdzõ²½½âÊÍÒ»ÏÂ,thisÊÇÖ¸Ïòµ±Ç°¶ÔÏóµÄÖ¸Õë(¹Ã ......

PHPÖÐdateº¯ÊýµÄÑ¡Ïî˵Ã÷

date() ½«·þÎñÆ÷µÄʱ¼ä¸ñʽ»¯
Óï·¨ÃèÊöΪstring date(string format,int[timestamp]);·µ»ØÖµµÄÊý¾ÝÀàÐÍÊÇ×Ö·û´®¡£
º¯Êý˵Ã÷£º·µ»ØÖµµÄ×Ö·û´®°´ÅäÖõĸñʽ¾ö¶¨¡£
×Ö·û´®¸ñʽ»¯µÄÑ¡ÏîÈçÏ£º
a: "am"»òÊÇ"pm"
A: "AM"»òÊÇ"PM"
d: ¼¸ÈÕ£¬Á½Î»Êý×Ö£¬Èô²»×ãÔò²¹Á㣻´Ó"01"ÖÁ"31"
D: ÐÇÆÚ¼¸£¬3¸öÓ¢ÎÄ×Öĸ£¬Èç:"Fri" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ