PHPÖеij£ÓõÄ25¸öMYSQLº¯Êý
1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or dir(”²»ÄÜÁ¬½Óµ½Mysql Server”);
˵Ã÷£ºÊ¹ÓøÃÁ¬½Ó±ØÐëÏÔʾµÄ¹Ø±ÕÁ¬½Ó
2¡¢mysql_pconnect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_pconnect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_pconnect(”localhost”, “username”, “password”) or dir(”²»ÄÜÁ¬½Óµ½Mysql Server”);
˵Ã÷£ºÊ¹ÓøÃÁ¬½Óº¯Êý²»ÐèÒªÏÔʾµÄ¹Ø±ÕÁ¬½Ó£¬ËüÏ൱ÓÚʹÓÃÁËÁ¬½Ó³Ø
3¡¢mysql_close()-¹Ø±ÕÊý¾Ý¿âÁ¬½Ó
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or die(”²»ÄÜÁ¬½Óµ½Mysql Server”);
@mysql_select_db(”MyDatabase”) or die(”²»ÄÜÑ¡ÔñÕâ¸öÊý¾Ý¿â£¬»òÊý¾Ý¿â²»´æÔÚ”);
echo “ÄãÒѾÁ¬½Óµ½MyDatabaseÊý¾Ý¿â”;
mysql_close();
4¡¢mysql_select_db()-Ñ¡ÔñÊý¾Ý¿â
¸ñʽ£º
boolean mysql_select_db(string db_name [, resource link_id])
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or die(”²»ÄÜÁ¬½Óµ½Mysql Server”);
@mysql_select_db(”MyDatabase”) or die(”²»ÄÜÑ¡ÔñÕâ¸öÊý¾Ý¿â£¬»òÊý¾Ý¿â²»´æÔÚ”);
5¡¢mysql_query()-²éѯMySQL
¸ñʽ£º
resource mysql_query (string query, [resource link_id])
Àý£º
$linkId = @mysql_connect(”localhost”, “username”, “password”) or die(”²»ÄÜÁ¬½Óµ½Mysql Server”);
@mysql_select_db(”MyDatabase”) or die(”²»ÄÜÑ¡ÔñÕâ¸öÊý¾Ý¿â£¬»òÕßÊý¾Ý¿â²»´æÔÚ”);
$query = “select * from MyTable”;
$result = mysql_query($query);
mysql_close();
˵Ã÷£ºÈôSQL²éѯִÐгɹ¦£¬Ôò·µ»Ø×ÊÔ´±êʶ·û£¬Ê§°Üʱ·µ»ØFALSE¡£ÈôÖ´Ðиüгɹ¦£¬Ôò·µ»ØTRUE£¬·ñÔò·µ»ØFALSE
6¡¢mysql_db_query()-²éѯMySQL
¸ñʽ£º
re
Ïà¹ØÎĵµ£º
×î½üÊÕµ½·´À¡£¬ºÜ¶à¿Í»§Á¬MySql¶¼ÎÞ·¨ÕýÈ·°²×°¡£ÊÕµ½ÈÎÎñ£¬Òª½«MySql´òµ½²úÆ·ÖУ¬ºÍ²úÆ·Ò»Æð°²×°ºÍжÔØ£¬À¿ª¼Ü
ʽ¸É°É£¬Ã»·¨×Ó¡£
Ñо¿Ò»Õ󣬷¢ÏÖ½«°²×°ºÃµÄMySqlÎļþ¼ÐCopyµ½ÆäËüµçÄÔÉÏ£¬ÔÙ½â¾öºÃÁ½¸öÎÊÌâÓ¦¸Ã¾Í¿ÉÒԺͰ²×°°æÒ»ÑùÕý³£Ê¹Óá£
1.Copyµ½ÁËÆäËüµçÄÔÉϵIJ»Í¬Ä¿Â¼£¬Ó¦¸ ......
mysql procedure ûÓÐreturn²ÎÊý ¿ÉÒÔoutÒ»¸ö±äÁ¿¸ø¿Í»§¶Ë µ«ÊÇout²ÎÊýÓÖ²»Ö§³ÖÓαêÀàÐÍ£¬ÈçºÎÄÜout³öÒ»¸ö½á¹û¼¯ÄØ£¿
·½·¨ºÜ¼òµ¥ ¾ÍÊÇÔÚprocedureÀïÖ´ÐÐÒ»¸öselect £¨select .... from ...£©
eg.
CREATE PROCEDURE `CREATE_ACCOUNT`(
ACCOUNT CHAR(32),
PASSWORD CHAR(32), ......
×î½ü×öÁ˼¸¸öСÐ͵ÄÏîÄ¿£¬±È½Ï¼òµ¥£¬Ö»ÊÇÐèҪϸÐÄ£¬¶¼¿ÉÒÔÍê³É£¬Ö÷ÒªÊǶÔMVCģʽµÄÊìÁ·Ó¦Ó㬶ÔWEBÀ࿪·¢»¹ÊǺÜÓаïÖúµÄ¡£
¸Õ¿ªÊ¼µÄµÚÒ»¸öСÏîÄ¿£¬ÓÃÀ´Á·ÊÖ£¬È»ºóÎÒÈ«²¿ÊÇÁ÷³Ì»¯µÄ±à³Ì¡£´úÂëÒ²¾Í400ÐÐ×óÓÒ¡£½á¹ûÎҵĵ¼Ê¦£¬¾õµÃ´úÂë½á¹¹²»ÇåÎú£¬²»ÈÝÒ×
ά»¤£¬ÐèÒªÐ޸ġ£ÐèÒªÎÒ²ÉÓÃOOÀàµÄ±à³Ì·½Ê½½øÐиÄд¡£ÎÒÒÔǰдPHP£¬¼¸ ......
ÔÎÄת×Ô £ºhttp://home.phpchina.com/space.php?uid=49655&do=blog&id=182488
Ò»£® ±Ø±¸ÖªÊ¶
1.wsdl(web·þÎñ±ê¼ÇÓïÑÔ)
WSDL£¨ÍøÂç·þÎñÃèÊöÓïÑÔ£¬Web Services Description Language£©ÊÇÒ»ÃÅ»ùÓÚ XML
µÄÓïÑÔ£¬ÓÃÓÚÃèÊö Web Services ÒÔ¼°ÈçºÎ¶ÔËüÃǽøÐзÃÎÊ¡£
......
1¡¢Ç°ÑÔ
·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×ÔÈ»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔºó¶ÔÓÚ·ÖÒ³ÏÔʾµÄÔÀíºÍʵÏÖ·½· ......