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

mysqlµÄ¸ßЧ´æÈ¡¹ý³Ì·ÖÒ³

 10wÒÔÉÏÊý¾ÝµÄЧÂʱÈÆÕͨ·ÖÒ³ ¿ì4-5±¶
PROCEDURE p_pageList (m_pageNo int , m_perPageCnt int , m_indexcolumn varchar(100), m_column varchar(1000) , m_table varchar(1000) , m_condition varchar(1000), m_orderBy varchar(200) , inout m_totalPageCnt int)
BEGIN
IF m_totalPageCnt >=1 THEN
 SET @sqlCnt = CONCAT('select count(1) into @pageCnt from ',m_table); -- 这条语句很关键,用来得到总数值
 IF m_condition IS NOT NULL AND m_condition <> '' THEN
  SET @sqlCnt = CONCAT(@sqlCnt,' where ',m_condition);
 END IF;
 PREPARE s_cnt from @sqlCnt;
 EXECUTE s_cnt;
 DEALLOCATE PREPARE s_cnt;
 SET m_totalPageCnt = @pageCnt;
else
 SET @pageCnt = 1; -- 总记录数
 SET @limitStart = (m_pageNo - 1)*m_perPageCnt;
 SET @limitEnd = m_perPageCnt;
 SET @sql = CONCAT('select ',m_column,' from ',m_table);  -- 主查询
 SET @wsql = CONCAT('select ',m_indexcolumn,' from ',m_table);  -- 子查询
 IF m_condition IS NOT NULL AND m_condition <> '' THEN
 SET @sql = CONCAT(@sql,' where ',m_condition);
 SET @wsql = CONCAT(@wsql,' where ',m_condition);
 END IF;
 IF  @limitStart<1000 THEN
  IF m_orderBy IS NOT NULL AND m_orderBy <> '' THEN
  SET @sql = CONCAT(@sql,' order by ',m_orderBy);
  END IF;
  SET @sql = CONCAT(@sql, ' limit ', @limitStart, ',', @limitEnd);
 Else
  IF m_orderBy IS NOT NULL AND m_orderBy <> '' THEN
   SET @wsql = CONCAT(@wsql,' o


Ïà¹ØÎĵµ£º

MySQLΪʲô»áÓÐÒ»´ó¶ÑÔÚSleepµÄ½ø³Ì£¿

¹ØÓÚphpÓ¦¸ÃÔÚºÎʱµ÷ÓÃmysql_close()ÒÔ¼°pconnect·½Ê½ºÍ´«Í³·½Ê½ÓкÎÖÖÇø±ðÊÕ²Ø
ÒÔÇ°ÎÒÒ»Ö±ÈÏΪ£¬µ±phpµÄÒ³ÃæÖ´ÐнáÊøʱ£¬»á×Ô¶¯ÊͷŵôÒ»ÇС£ÏàÐźܶàÈ˶¼¸úÎÒÏëµÄÒ»Ñù¡£µ«ÊÂʵ֤Ã÷²¢²»ÊÇÕâÑù¡£±ÈÈçsession¾Í²»»áËæ×ÅÒ³ÃæÖ´ÐÐÍê±Ï¶øÊÍ·Å¡£
phpµÄÀ¬»ø»ØÊÕ»úÖÆ£¬ÆäʵֻÕë¶ÔÓÚphp±¾Éí¡£¶ÔÓÚmysql£¬phpûȨÀûÈ¥×Ô¶¯È¥ÊÍ·ÅËüµÄ ......

MySQL]MYSQL³£¼û³ö´í´úÂë mysql error number

 1016´íÎó£ºÎļþÎÞ·¨´ò¿ª£¬Ê¹Óúǫ́ÐÞ¸´»òÕßʹÓÃphpmyadmin½øÐÐÐÞ¸´¡£
1044´íÎó£ºÊý¾Ý¿âÓû§È¨ÏÞ²»×㣬ÇëÁªÏµ¿Õ¼äÉ̽â¾ö
1045´íÎó£ºÊý¾Ý¿â·þÎñÆ÷/Êý¾Ý¿âÓû§Ãû/Êý¾Ý¿âÃû/Êý¾Ý¿âÃÜÂë´íÎó£¬ÇëÁªÏµ¿Õ¼äÉ̼ì²éÕÊ»§¡£
1054´íÎ󣺳ÌÐòÎļþ¸úÊý¾Ý¿âÓгåÍ»£¬ÇëʹÓÃÕýÈ·µÄ³ÌÐòÎļþÉÏ´«ÉÏÈ¥¸²¸Ç¡£
1146´íÎó£ºÊý¾Ý±íȱʧ,Çë»Ö ......

mysqlÃüÁî´óÈ«

Æô¶¯£ºnet start mySql;
¡¡¡¡½øÈ룺mysql -u root -p/mysql -h localhost -u root -p databaseName;
¡¡¡¡ÁгöÊý¾Ý¿â£ºshow databases;
¡¡¡¡Ñ¡ÔñÊý¾Ý¿â£ºuse databaseName;
¡¡¡¡Áгö±í¸ñ£ºshow tables£»
¡¡¡¡ÏÔʾ±í¸ñÁеÄÊôÐÔ£ºshow columns from tableName£»
¡¡¡¡½¨Á¢Êý¾Ý¿â£ºsource fileName.txt;
¡¡¡¡Æ¥Åä× ......

C#.NETÁ¬½Ómysql·½·¨


 mysql.data.dll¿½±´µ½binÏÂÃæ²¢ÒýÓÃÒ»ÏÂ
using MySql.Data.MySqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string myConnectionString = "Database=test;Data Source=localhost;User Id=root;Password=admin" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ