Ò»¸ömysqlµÄ´æ´¢¹ý³Ì£¬ÄÄÀïÓÐÎÊÌ⣿
SQL code:
create procedure(in w varchar(20),out c int)
begin
set @sqlcount=concat('select count(*) into @c from scms_product where ',w);
prepare stm1 from @sqlcount;
execute stm1;
set c=@c;
set @sql=concat('select * from scms_product where ',w);
prepare stm2 from @sql;
execute stm2;
end
ÉÏÃæµÄ´æ´¢¹ý³ÌÔÚmysqlÀïÔËÐÐÕý³££¬ÒªÇóÔÚphpÀïµÃµ½out±äÁ¿cµÄÖµ£¬php´úÂëÊÇÕâÑùµÄ
PHP code:
$rs=$mysqli->query("call p5('cateid=5',@c)");
$res=$mysqli->query("select @c");
$row=$res->fetch_row();
echo $row[0];
ÔËÐеÄʱºò¾Í»á³öÏÖ´íÎóÌáʾ£¬Call to a member function fetch_row() on a non-object Èç¹ûÎÒÈ¥µô´æ´¢¹ý³ÌÖеÄ
set @sql=concat('select * from scms_product where ',w);
prepare stm2 from @sql;
execute stm2;
Õ⼸ÐоÍÕý³£ÁË£¬ÇëÎÊÎÒµÄphp³ÌÐò¸ÃÔõôд£¿{{--
Ïà¹ØÎÊ´ð£º
ÈçÌ⣬MySQL²»»áÕâÑù°É
Ö§³Ö£¬Ä㽨Á¢Êý¾Ý¿âµÄʱºòÖ¸¶¨×Ö·û¼¯utf8»òÕßgbk¾ÍÐÐÁË¡£
http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
MySQL ÖÐÎÄÏÔʾÂÒÂë
Ö§³Ö£¬¼ì²é×Ö·û¼¯ÉèÖÃ
Ö§³Ö£¬¼ì² ......
ÎÒ¿ª·¢ASP.netʱ
²åÈëÍâÎÄÂÒÂë
SHOW VARIABLES LIKE 'character%';
Õâ¸öʱºò
character_set_client utf8
character_set_connection utf8
character_set_database utf8
ch ......
ÎÒ°²×°µÄÕâ¸öÈí¼þVertrigoServ£¬ÔÚwindows7ÖÐÔËÐУ¬Í¼±ê¼ÓºÅΪÀ¶É«£¬±¨MySQLµÄ´íÎó£¬Çë½Ì¸÷λ¸ßÊÖ¸ÃÔõÑù¸ü¸Ä¡£Ð»Ð»¸÷λ£¡
mysql ·þÎñÊÇ·ñÆðÀ´ÁË£¿
ûÓУ¬±¨µÄÊǶ˿ڴíÎó£¬ÔÚÅäÖÃÎļþµ±ÖиÄÁË£¬Ò²²»ÐÐ
¿ÉÒÔÓÃÈ ......
ÏÈÉÏ´íÎó
ÎÞ·¨Áª½ÓÊý¾Ý¿â
java.sql.SQLException: Before start of result set
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java: ......
ÎÒÒѾ°´Õս̳ÌÉÏÅäÖÃtomcatµÄserver.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......