Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is by design in the SQL dialects I can think of offhand. I know several people who, out of habit, add <code>order by 0 desc</code> or <code>order by 1</code> to ad hoc queries, the first to pick what typically is the ID column and the second what is often a "Name" column or similar. They're querying based on the ordinal position of the field in the query (or the schema, in the case of *)</p> <p>In order to get a column <em>named</em> 5, you need to use the appropriate SQL quoting mechanism for your dialect and configuration. As an example, Microsoft Sql and Access would typically use <code>select * from tablecomments where [5]=5</code>; in Postgres and Oracle you'd use <code>select * from tablecomments where "5"=5</code>, and in Mysql, Quoted Identifiers are quoted with a backtick <code>select * from tablecomments where `5`=5</code>. In Microsoft SQL you can also make things more like Oracle and Postgres if your session has SET QUOTED_IDENTIFIER ON, in which case you'd use quotes instead of square brackets.</p> <p>As an aside, but a very important one, you should not take user input and directly embed it in SQL. If someone were to intercept the HTTP transmission between your Android app and your PHP app (trivial with a proxy like Charles or Fiddler), they'd be able to replay the http request with arbitrary SQL injected. As other commenters have noted, please use a parameterized query instead.</p> <p>Since you're trying to modify the query itself rather than the parameters, you may need to consider whitelisting the allowed field names (or compare the string you're sent against the fields represented in the schema).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload