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

Óà PHP µ÷Óà MySQL ´æ´¢¹ý³Ì

    MySQL 5.0 ÒÔÉÏÖ§³Ö´æ´¢¹ý³Ì¡£
    PHP 5.0 ÒÔÉ쵀 mysqli ϵÁк¯Êý¿ÉÒÔÖ§³Ö²Ù×÷ MySQL µÄ´æ´¢¹ý³Ì¡£
    ÒÔÏÂÊÇһЩ¼òµ¥µÄ´æ´¢¹ý³ÌºÍÓà PHP µ÷ÓõÄʾÀý¡£     Ò»¡¢·µ»Øµ¥¸öÊý¾Ý: 1: <?php
2: header("Content-Type:text/html;charset=utf-8");
3:  
4: $host = "localhost";
5: $user = "root";
6: $password = "mypassword";
7: $db = "test_store_proc";
8: $dblink = mysqli_connect($host, $user, $password, $db) or die("can't connect to mysql");
9:  
10: $dblink->query('SET NAMES UTF8');
11: if ($result = $dblink->query("CALL sp_test0(@num, @x, 123)"))
12: {
13: $rs = $dblink->query("select @num");
14: $row = $rs->fetch_array();
15: echo $row['@num'], '<br>';
16:  
17: $rs = $dblink->query("select @x");
18: $row = $rs->fetch_array();
19: echo $row['@x'];
20:  
21: mysqli_free_result($rs);
22: }
23: else
24: echo 'error...';
25: mysqli_close($dblink);
26:  
27: /*
28: -- Procedure "sp_test0" DDL
29: CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_test0`(OUT num INT, OUT x VARCHAR(16), IN n INT)
30: BEGIN
31: DECLARE nouse int;
32: DECLARE tmp int;
33:  
34: SELECT nId INTO nouse from open_news WHERE nID=39;
35: SELECT count(*) INTO tmp from open_news;
36: SET num = tmp;
37:  
38: SET x = 'XXX';
39: END;
40: */
41: ?>
42:  
     ¶þ¡¢·µ»Ø½á¹û¼¯:
1: <?php
2: header("Content-Type:text/html;charset=utf-8");
3:  
4: $host = "localhost";
5: $user = "root";
6: $password = "mypassword";
7: $db = "te


Ïà¹ØÎĵµ£º

PHP³ÌÐòÔ±²»¿É²»ÖªµÄÊ®´óÏîÄ¿

PHPµÄÁ÷ÐУ¬¾ø²»ÊÇżȻµÄ£¬¸÷ÖÖ¿ªÔ´¸¨ÖúÏîÄ¿Æðµ½Á˲»Ð¡µÄ×÷Óá£
1. ·¢ËÍÓʼþ phpmailer
2. ¹ÜÀíÓû§ Php user class
3. ץȡRSSժҪ Magpie RSS
4. »ñÈ¡·ÃÎÊÕߵĵØÀíÐÅÏ¢ Maxmind
5. »ñȡԶ³ÌÄÚÈÝ  htmlSQL class
6. Trackback  php trackback
7. Ä£°åϵͳ£¬µ±È»¾ÍÊÇSmarty ÁË
8. BBcode StringParser_B ......

MyEclipse+Tomcat+MySQLµÄ»·¾³´î½¨£¨2010Äê3ÔÂ5ÈÕ)

Ò». ÉèÖò½Ö裺1¡¢ÓÒ¼üµã»÷ÎҵĵçÄÔ£¬Ñ¡ÔñÊôÐÔ£¨¼ûͼ-1£©      
1¡¢µã»÷¸ß¼¶£¬ÔÚ¶Ô»°¿òµÄϲ¿µã»÷»·¾³±äÁ¿
 3¡¢ÔÚϵͳ±äÁ¿¶Ô»°¿òÖУ¬µã»÷н¨½øÐÐÉèÖÃ.
±äÁ¿Ãû£ºJAVA_HOME
±äÁ¿Öµ£ºC:\Program Files\Java\jdk1.6.0_05£¨ÔÚ´ËʹÓõÄÊÇĬÈϰ²×°Â·¾¶£©
ϵͳ±äÁ¿->±à¼­->±ä ......

windowsÏÂPHP5+APACHE+MYSQLÍêÕûÅäÖÃ

Èí¼þ°æ±¾:
php-5.2.13-Win32
apache_2.2.9-win32-x86-no_ssl-r2.msi(×¢Ò⣺APACHE 2.2.X°æ±¾ÒÔÉÏÒªÔö¼Ó²å¼þ²ÅÖ§³ÖPHP 5µÄ)
mysql-5.1.44-win32.msi
ÏÈ×°µÄphp5,Ö±½Ó½âѹÎļþµ½C:\php(°²×°µ½ÄÄÀï²¢²»»áÓÐÓ°Ï죬ƾ¸öÈËϲºÅ£¬±¾ÎÄÖеÄËùÓз¾¶¶¼ÒÔÎҵݲװ·¾¶£¬Çë´ó¼ÒÔÚ×Ô¼ºµÄ»úÆ÷Éϰ²×°µÄʱºò×¢ÒâÐÞ¸ÄΪ×Ô¼ºµÄ·¾¶)
½Ó× ......

¾­µäMYSQLÓï¾ä

SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(Create£¬Alter£¬Drop£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(Select£¬Delete£¬Update£¬Insert)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
Create DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ