本文介绍了在phpmyadmin存储过程脚本中获取错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在phpmyadmin中创建一个存储过程,它获取事件类别列表。条件即时使用,即时发送一个参数''e_range''我根据我设置此参数3,4等的范围得到列表,但我在执行此脚本时遇到错误:



#1064 - 您的SQL语法出错;检查与您的MySQL服务器版本相对应的手册,以便在''e_range附近使用正确的语法;否则从第4行的''类别选择category_id,category_name,category_thumb



Im creating a stored procedure in phpmyadmin, which get the event category list. The condition im using, im sending a parameter ''e_range'' where i get the list on the basis of whatever i set the range on this parameter 3, 4 etc. but im getting an error in while executing this script:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''e_range; else select category_id, category_name, category_thumb from category'' at line 4

CREATE PROCEDURE `sp_category_list`(IN e_range int)
BEGIN
if(e_range != 0) then
    select category_id, category_name, category_thumb from category_list order by category_name limit e_range;
else
    select category_id, category_name, category_thumb from category_list order by category_name;
END if;
END$$





现在的问题是,这个脚本在我的localhost pc上运行良好。但我在我的网络服务器CPANEL的phpmyadmin上得到这些错误。 MySQL关键字''LIMIT''没有通过参数获取值。或者可能没有认出来。但是当我从select命令中删除此参数并在其上设置静态数字时,它将起作用:



Now problem is that, this script working good in my localhost pc. but im getting these error on my webserver CPANEL''s phpmyadmin. the MySQL keyword ''LIMIT'' is not taking the value through parameter. or maybe not recognizing it. but when i remove this parameter from the select command and set the static number on this, it will work:

select category_id, category_name, category_thumb from category_list order by category_name limit 5;





现在是什么程序,所以我将通过我给定的参数得到列表。



谢谢:)



now what is the procedure, so i will get the list through my given parameter.

Thank you :)

推荐答案





现在的问题是,这个脚本在我的localhost pc上运行良好。但我在我的网络服务器CPANEL的phpmyadmin上得到这些错误。 MySQL关键字''LIMIT''没有通过参数获取值。或者可能没有认出来。但是当我从select命令中删除此参数并在其上设置静态数字时,它将起作用:



Now problem is that, this script working good in my localhost pc. but im getting these error on my webserver CPANEL''s phpmyadmin. the MySQL keyword ''LIMIT'' is not taking the value through parameter. or maybe not recognizing it. but when i remove this parameter from the select command and set the static number on this, it will work:

select category_id, category_name, category_thumb from category_list order by category_name limit 5;





现在是什么程序,所以我将通过我给定的参数得到列表。



谢谢:)



now what is the procedure, so i will get the list through my given parameter.

Thank you :)


这篇关于在phpmyadmin存储过程脚本中获取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 05:34