mysqlµ÷Óúó
ÓÃmysql_query£¬mysql_fetch_array()ºóÓ¦¸ÃÒª
free_result().function count_admin($where = '')
{
if($where) $where = " WHERE $where";
$result = $this->db->get_one("SELECT count(*) as num from $this->table_admin_role $where");
return $result['num'];
}
Ïà¹ØÎĵµ£º
Link from : http://www.5ilinux.com/blog/archives/000091.html
1.Ê×ÏÈÎÒÃǽ¨Á¢ÏàÓ¦µÄÓû§ºÍÓû§×é
groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser
2.²Ù×÷Êý¾Ý¿â
mysql mysql -uroot -ppassword
create database ftpdb
grant select, upd ......
Ò»Ö±ÒÔΪmysqlËæ»ú²éѯ¼¸ÌõÊý¾Ý£¬¾ÍÓÃ
SELECT
*
from
`
table
`
ORDER
BY
RAND
() LIMIT
5
¾Í¿ÉÒÔÁË¡£
µ«ÊÇÕæÕý²âÊÔһϲŷ¢ÏÖÕâÑùЧÂʷdz£µÍ¡£Ò»¸ö15ÍòÓàÌõµÄ¿â£¬²éѯ5ÌõÊý¾Ý£¬¾ÓȻҪ8ÃëÒÔÉÏ
²é¿´¹Ù·½ÊֲᣬҲ˵rand()·ÅÔÚORDER BY ×Ó¾äÖлᱻִÐж ......
¸ømysql¿ªÒ»¸ö¿ÉÒÔÔ¶³Ì·ÃÎʵÄÓû§ÃüÁîÈçÏÂ:
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
"*.*" ±íʾÊý¾Ý¿âÖÐËùÓеıí,Ò²¿ÉÒÔ»»³ÉÖ¸¶¨µÄ±íÈçtest.*
"myuser" ±íʾµÄÊÇ·ÃÎʵÄÓû§Ãû;
"%" ±íʾËùÓеÄÖ÷»ú¼´ÈκεÄÖ÷»ú¶¼¿ÉÒÔͨ¹ýÕâ¸öÓû§Ãû·ÃÎÊÎÒµÄÊý¾Ý¿â,Ò²¿ÉÒԸóÉÌض¨µ ......
Some problems encounted this afternoon, when trying to setup/test mysql capabilities on hypnos and virgil.
1.ERROR 2003 (HY000): Can't connect to MySQL server on 'server-name' (111)
access locally (i.e. from localhost) is fine, when trying remotely got this error. when tried with mysql++ library, ......
×òÌìÓиö¹¦ÄÜҪʵÏÖÅÅÐÐЧ¹û£¬¶øÇÒÊÇËæ»ú°´ÕÕijЩ×ֶεÄ×ÜÖµ£¬µ«ÊǵÚÒ»¸öÓÖÒª²»Ò»Ñù£¬ÒòΪµÚÒ»¸öÈ˸øÁËÇ®£¬ËùÒÔÒªÅŵÚÒ»¡£
´ò¸ö±È·½°É£¬±í(userinfo)ÖÐÓÐÕ⼸¸ö×ֶΣºusername,isvalid,givedmoney,sumip,dayip,monthip,visitcount,regdate
ÏÖÔÚҪʵÏÖÏÔʾÅÅÐÐÇ°10λÓû§£¬
³öÏÖÔÚÅÅÐеÚһλµ ......