Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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·ÃÎʺ¯Êý¶¼ÐèÒªÓÐÏàÓ¦µÄȨÏÞ²ÅÄÜÔËÐÐ


Ïà¹ØÎĵµ£º

MySqlÓû§´´½¨¡¢ÊÚȨÒÔ¼°É¾³ý(תÌù)

he create user command:
mysql
> CREATE
 
USER
 yy IDENTIFIED 
BY
 
'
123
'
;
yy±íʾÄãÒª½¨Á¢µÄÓû§Ãû£¬ºóÃæµÄ123±íʾÃÜÂë
ÉÏÃ潨Á¢µÄÓû§¿ÉÒÔÔÚÈκεط½µÇ½¡£
Èç¹ûÒªÏÞÖÆÔڹ̶¨µØÖ·µÇ½£¬±ÈÈçlocalhost µÇ½£º
mysql
> CREATE
 
USER
 yy@localhost
&n ......

¡¾Õª×ÔCSDNÂÛ̳¡¿mysqlÃüÁîÐг£ÓÃÃüÁî

mysqlÃüÁîÐг£ÓÃÃüÁî
µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
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 ......

PHPµ÷ÊÔµÄÒ»°ã²½Öèѧϰ¼Ç¼

    ±¾ÎÄÖ»ÊÇÔÚ³¢ÊÔPHPµ÷ÊÔºó»ñµÃµÄÈô¸É¾­ÑéµÄ¼Ç¼¡£
    PHPµÄIDEµ÷ÊÔ¶¼±È½ÏÍ´¿à£¬Ò»°ãºÜÄÑÓм¯³ÉµÄIDE¡£ÔÚÏ°¹ßÓÃMyEclipseµ÷ÊÔJSPÓ¦Óúó£¬ÔÙÈ¥¿ª·¢PHP³ÌÐò×ܾõµÃÌرðÂé·³£¬Æä×î´óÔ­Òò¿ÉÄܾÍÊǵ÷ÊÔ»·¾³µÄ°²×°ºÍÅäÖᣱÊÕß³¢ÊÔ¹ýN´Î£¬Ê²Ã´xDebug£¬DBG Script£¬Zend Debugger£¬Í³Í³ÕûÁËÒ»±é£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ