ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[±Ð¾Ç] ²Ä7³¹ ³sµ²»P«Ø¥ß¸ê®Æ®w(7-1 PHP»PAccess¡BMS SQLªº³sµ²)

[±Ð¾Ç] ²Ä7³¹ ³sµ²»P«Ø¥ß¸ê®Æ®w(7-1 PHP»PAccess¡BMS SQLªº³sµ²)

²{¤µªººô¸ô¹q¤l°Ó°È§K¤£¤F­n»P¸ê®Æ®w§è¤WÃö«Y¡A³o¸Ì©Ò«üªº¸ê®Æ®w¬O¡GWeb Server ¤Wªº¸ê®Æ®w³á¡I¨ä¹ê¸ê®Æ®w¤£´N¬O¤@­ÓÀɮסA¦ý¬O¡A¥¦¬O¤@­Óµ²ºc¤ÆÀx¦s¸ê®Æªº®æ¦¡ÀɮסC¨ä¹ê§Ú­Ì±`±`¦b¨Ï¥Î¸ê®Æ®w¦Ó¤£¦Ûª¾¡A«ç»ò»¡¡H§A¦³¨S¦³¾Þ§@¹L.mdb ªºÀÉ®×°Ú¡H¥¦´N¬O¤@­Ó Access ®æ¦¡ªº¸ê®Æ®wÀɮסC

7-1   PHP»PAccess¡BMS SQLªº³sµ²
ÁöµM¥»®Ñªº¸ê®Æ®w­«ÂI¤£¬OAccess©Î¬OMS SQL¡A¦ý¬O¬°¤FÅý±z¤F¸ÑPHP¨Ã«D­­©w«áºÝ¸ê®Æ®w¥u¯à¨Ï¥ÎMySQL¡A©Ò¥H¦b¥»¸`¤¤±Nµy·L¤¶²Ð£¸¤UPHP»PAccess¡BMS SQLªº³sµ²¤èªk¡A¦b¥»¸`¤§«áªº®ÑÄy¤º®e¡A±N§¹¥þ°w¹ï¥»®Ñªº¥D¨¤¥t£¸¥D¨¤¡uMySQL¡v¡A¦b¦¹¥ý¦V¦U¦ìŪªÌ³ø§i¤@¤U¡C

­n¹ï¸ê®Æ®w¦s¨ú¸ê®Æ¥²¶·¥ý¶i¦æ¸ê®Æ®wªº³sµ²ªº°Ê§@¡A´N¦p¦P§Ú­Ì­nŪ¨úÀɮ׸ê®Æ®É¥Îfopen()¨ç¼Æ¶}±ÒÀɮפ@¯ë¡A­n¹ïAccess¡BSQL Server¶i¦æ³sµ²°Ê§@¥i¨Ï¥ÎODBC¸ê®Æ®w¨ç¼Æ¡G¡uodbc_connect()¡v©Î¡uodbc_pconnection()¡v¨ç¼Æ¡C


odbc_connect() ¨ç¼Æ
  1. resource odbc_connect ( string dsn, string user, string password [, int cursor_type])
½Æ»s¥N½X
·í¸ê®Æ®w³sµ²¦¨¥\«h¦^¶Ç³s½uªº½s¸¹¡A­Y³s½u¥¢±Ñ«h¦^¶Ç0¡C


odbc_pconnect() ¨ç¼Æ
  1. resource odbc_pconnect ( string dsn, string user, string password [, int cursor_type])
½Æ»s¥N½X
·í¸ê®Æ®w³sµ²¦¨¥\«h¦^¶Ç³s½uªº½s¸¹¡A­Y³s½u¥¢±Ñ«h¦^¶Ç0¡C


odbc_close() ¨ç¼Æ
  1. void odbc_close ( resource connection_id)
½Æ»s¥N½X
odbc_connect()¨ç¼Æ¬O¼È®É©Êªº³s½u¡A¨C¦¸³sµ²³£·|¨Ï¸ê®Æ®w²£¥Í¤@­Ó·sªº³s½uªÌ¡A©Ò¥H¨C¦¸³sµ²«á¡A·í¤£»Ý­n¦¹³s½u®É´N¸Ó¥Î¡uodbc_close()¡v¨ç¼ÆÃö³¬³sµ²¡A¤£µM±zªº¸ê®Æ®w©Î¦øªA¾¹­t¾á¤Ó­«´N·|¥X°ÝÃD¡C
odbc_pconnect()¨ç¼Æ¬O¿W¥e©Êªº³s½u¡A·í»P¸ê®Æ®w©¹ªðªº¸ê®Æ¤j®É¡A¥i¨Ï¥Î¦¹¨ç¼Æ³sµ²¸ê®Æ®w¡A§Y¨ÏPHPµ{¦¡¤w¸g°õ¦æ§¹²¦¡A¦¹³s½u¨ÌµM¦s¦b¡A­Y¦¹³s½u¼È®É¨S¦³¥Î¨ì«h³s½u¶i¤J¡u¥ð¯v¡]sleep¡^¡vª¬ºA¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¹ï©óSQL Server¡A°£¤F¥i¨Ï¥ÎODBC¸ê®Æ®w¨ç¼Æ¸s¥~¡APHP¥ç´£¨Ñ¤FSQL Server±MÄݪºMSSQL¨ç¼Æ¸s¡A¦]¦¹³sµ²SQL Server¸ê®Æ®w¤]¥i¥H¨Ï¥Î¡umssql_connect()¡v©Î¡umssql_pconnection()¡v¨ç¼Æ¡A¦pªG±zªº¸ê®Æ«áºÝ¬°SQL Server¡A«Øij±z¨Ï¥ÎSQL Server±MÄݪºMSSQL¨ç¼Æ¸s¡C


mssql_connect() ¨ç¼Æ
  1. int mssql_connect ( [string servername [, string username [, string password]]])
½Æ»s¥N½X
·í¸ê®Æ®w³sµ²¦¨¥\«h¦^¶Ç³s½uªº½s¸¹¡A­Y³s½u¥¢±Ñ«h¦^¶Ç0¡C


mssql_pconnect() ¨ç¼Æ
  1. int mssql_pconnect ( [string servername [, string username [, string password]]])
½Æ»s¥N½X
·í¸ê®Æ®w³sµ²¦¨¥\«h¦^¶Ç³s½uªº½s¸¹¡A­Y³s½u¥¢±Ñ©Îµo¥Í¿ù»~«h¦^¶Çfalse¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD