mysql´¢´æ¹ý³ÌµÄÎÊÌâ
ÎÒÏÖÔÚѧϰMYSQL£¬ÎÊÏÂmysql´¢´æ¹ý³ÌÈçºÎ½¨Á¢ºÍʹÓã¬×îºÃд³É$sql="sqlÓï¾ä",$re=mysql_query($sql);лл
½¨ÒéÄãÏÈ×Ô¼º¿´Ò»ÏÂÎĵµÖеÄÀý×Ó¡£
http://dev.mysql.com/doc/refman/5.1/zh/stored-procedures.html
20. ´æ´¢³ÌÐòºÍº¯Êý
20.1. ´æ´¢³ÌÐòºÍÊÚȨ±í
20.2. ´æ´¢³ÌÐòµÄÓï·¨
20.2.1. CREATE PROCEDUREºÍCREATE FUNCTION
20.2.2. ALTER PROCEDUREºÍALTER FUNCTION
20.2.3. DROP PROCEDUREºÍDROP FUNCTION
20.2.4. SHOW CREATE PROCEDUREºÍSHOW CREATE FUNCTION
20.2.5. SHOW PROCEDURE STATUSºÍSHOW FUNCTION STATUS
20.2.6. CALLÓï¾ä
20.2.7. BEGIN ... END¸´ºÏÓï¾ä
20.2.8. DECLAREÓï¾ä
20.2.9. ´æ´¢³ÌÐòÖеıäÁ¿
20.2.10. Ìõ¼þºÍ´¦Àí³ÌÐò
20.2.11. ¹â±ê
20.2.12. Á÷³Ì¿ØÖƹ¹Ôì
20.3. ´æ´¢³ÌÐò¡¢º¯Êý¡¢´¥·¢³ÌÐòºÍ¸´ÖÆ£º³£¼ûÎÊÌâ
¾ÍÒòΪÕâ¸ö²»Ì«¶®£¬ÎÒ¾ÍÊDz»»áÔõôÄܺÍPHP½áºÏµÄÎÊÌ⣡Íû½â´ð£¡
PHP code:
<?php
// Connecting, selecting database
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');
// Performing SQL query
$query = 'SELECT * from my_table';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<table>\n&qu
Ïà¹ØÎÊ´ð£º
ÓÃjsp×ö¶«Î÷¸øÍêÈ«²»¶®mysqlµÄÈËÓ㬿ÉÊDZ¸·ÝʱֻÓпÕÎļþ£¬ÕâÊÇʲôÇé¿ö£¬
×îºÃÓÐÔ´´úÂ룬лл
Æäʵ±¸·ÝµÄ¹ý³ÌÎÒÏë´ó¸ÅÊÇÕâÑùµÄ£º
½«±íAÖеÄÊý¾Ý·Åµ½ArrayListÖУ¬È»ºó½«Õâ¸öArrayListÖеÄÊý¾ÝÔÙ´æµ½±íBÖС£ ......
Ò»¸öÐÐÒµÍøÕ¾£¬ÒªÊµÏֵŦÄÜÒªÇóΪ£º
Ò»ËÑË÷±íµ¥¿ÉÑ¡ËÑË÷ ²úÆ·/×ÊѶ/É̼ң¬ËÑË÷ʱϣÍûÏÈËѱêÌâºóÈ«ÎÄ£¬µ±Ç°µÄÊý¾ÝÁ¿¹À¼Æ3Íò¶à£¬¶¨Î»ÆÚÍûÔÚ°ÙÍò¼¶Ò²¿ÉÓá£
Êý¾ÝÀàÐÍΪinnodb£¬µ±Ç°µÄ·½·¨ÊǶԹؼü´Ê½øÐÐ ......
ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......
MySQLÈëÃÅ
¿ÉÒÔÏÈ¿´Ê²Ã´Êé¼®°¡£¿
ÏȶÁÈý±é¡¶Êý¾Ý¿âϵͳ¸ÅÂÛ¡·,ÕÆÎÕÊý¾Ý¿âµÄ»ù´¡ÀíÂÛ¡£
È»ºóÔÙ´Ö¿´Ò»±éMYSQLµÄ¹Ù·½Îĵµ¡£ MySQL¹Ù·½Îĵµ http://dev.mysql.com/doc/refman/5.1/zh/index.html
¾ÍÕÒÒ»±¾ºÜ»ù´ ......
ÎÒÓÃDELET from WHERE NAME IS NULL »ò=¡®¡¯
¶¼²»Ðа¡
ÄDz»¿ÉÄܲ»Êǿգ¬ÊÇÆäËû×Ö·û
Êǿհ¡£¬Ã»´í°¡¡£
SQL code:
DELET from WHERE NAME IS NULL or LEN(NAME)=0 or UPPER(NAME)='NULL'
ÒýÓÃ
S ......