WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

Hi !
HTTP URL parameters do not have a type. When you load /order.sql?id=1000, there is no way to know whether the URL parameter id is intended to be a number, or a string that just happens to only contains digits in this case. So SQLPage handles all parameters as strings by default. However, it's easy to convert the parameter to an integer in SQL when you need it. Just replace your SQL query with

select *
from Order
where Id = CAST($id AS INTEGER)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@BlueHtml
Comment options

@lovasoa
Comment options

Answer selected by lovasoa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants