Questions tagged as 'order-by'

1
answer

ORDER BY in php with pagination ordering only the first page

I wrote the following code in php, I would like it to show the items in an ordered way according to the combobox of the form, but in it it only orders items from the first page. Thanks! <html lang="pt-br"> <head> <title&g...
asked by 03.11.2018 / 17:56
1
answer

How to enter a keyword in a search in the bank already done

For example, I did a search of all the user data in the bank to echo echoes in different columns through the site: $stmt = $conexao->prepare("SELECT * FROM esc_usuarios WHERE usu_codigo = ?"); $stmt->bind_param("s", $usu_codigo);...
asked by 23.10.2018 / 20:24
1
answer

Sort by custom fields and by date of publication

My problem is this, I have a post_type in the name of "collections" and inside it multiple posts with custom fields "situation-of-freck" and "collection of freckles". The result of these two fields are numbers, to make it easier to sort. I got h...
asked by 20.09.2018 / 22:01
1
answer

Query zeroing column when applying order by - Mysql

I have a query that when sorting it in ASC it zeroes a column of my table, however if I command in DESC it displays values normally. This is a query: SELECT 'tab_medicamentos'.'id', 'tab_medicamentos'.'classe_terapeutica', 'tab_medicamento...
asked by 11.05.2018 / 21:08
1
answer

Mysql - Order before grouping

I need to make a selection that will bring the last users who logged in without repeating the names. The problem is that the command below first groups and then sorts: SELECT usuario FROM tab_logins GROUP BY usuario ORDER BY data_login desc...
asked by 11.03.2018 / 17:47
1
answer

Using Angular "track by $ index" with pagination, filtering and sorting

Good morning! I'm having a bad problem when trying to use the Smart Table, with paging, filtering and searching in my table. I was with the table working when converting a JSON that consumed by an object request. In this case, I did: $sc...
asked by 05.06.2017 / 17:01
1
answer

Sort the table by the closest value of the parameter passed in stored procedures

How to sort a table according to the approximate value of a parameter passed in a stored procedure Ex: Let's say in a table the name field has the following values: Tiago, Iago and Thiago and I pass as a parameter in the stored procedure "...
asked by 18.03.2016 / 20:19
0
answers

Doctrine2 + pdo_sqlsrv createQueryBuilder Order By with varchar field does not work

I'm creating a method that gets values for createQueryBuilder () coming by parameters. I tested it in my local database with pdo_mysql driver and it worked perfectly, by ordering both an int (id) field and a varchar (title) type field. Howe...
asked by 02.12.2015 / 20:44
0
answers

Sort the datatable table by the date of the records

I have a code, which when starting, creates a table using dataTable . The data in this table comes from my MySQL database. I am not sure how my records are sorted, if I am not mistaken it is coming from the Id, but I need it to be sorted by t...
asked by 18.11.2015 / 14:06