Questions tagged as 'mysql'

1
answer

Sort records containing numbers at the end

I have a table with the following records: +----+------------+--------------+ | id | title | url | +----+------------+--------------+ | 1 | Olá Mundo! | ola-mundo-1 | | 5 | Olá Mundo! | ola-mundo-3 | | 6 | Olá Mundo! | ola-m...
asked by 14.02.2017 / 07:37
2
answers

SQL & PHP - Select everything using where

I'm doing a very simple filtering system using PHP and mysql . $stmt = $conexao->prepare("select * from filme where genero = '$genero'"); I'm wanting to put one in the genre list which, when selected, displays all the movies...
asked by 11.12.2018 / 21:38
2
answers

What is the correct way to choose the types of columns? [closed]

I always see tables as follows. Ex: CREATE TABLE posts ( id int(11) NOT NULL, titulo varchar(255) NOT NULL, autor varchar(255) NOT NULL, conteudo text NOT NULL, data varchar(11) NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8;...
asked by 18.12.2016 / 14:13
2
answers

How to make more than one select in the same query?

How can I make more than one select in the same query? I tried the following (using UNION), but it did not work: DATABASE Table: lines_cameras id_camera_linha | nome_linha_camera Table: Manufacturers id_fabricante | nome_fabri...
asked by 09.01.2017 / 13:23
1
answer

ERROR SYNTAX WHERE - PHP

I have the following code in php: $sql = "SELECT * FROM musicas_curtidas GROUP BY musica ORDER BY count(musica) WHERE musica != 'Rádio Turn - Você em primeiro lugar!' AND WHERE musica != 'Radio Turn - Não importa o seu estil...
asked by 10.01.2017 / 02:33
1
answer

How to average in SQL?

I have a job to do where I enter name and two notes into a database using VoiceXML. I have two tables, one with nome , notaum , notadois and another with nome , media . How do I calculate the average of notaum...
asked by 13.12.2016 / 15:15
1
answer

Android - Comparison between string and varchar [duplicate]

I'm having trouble comparing strings. One retreat from one EditText and the other from an SQL table. The app consists of a game of the genre " Who wants to be a millionare? " When it arrives at the if cycle of comparison between the two s...
asked by 07.12.2016 / 19:37
1
answer

Regen name of columns and values of MySQL

I want to get the name of the columns of a table and their respective records .. Ex: I have the table registers and it has the columns name, login, password and there are 2 records recorded in this table, getting + - like this: name = al...
asked by 31.07.2014 / 10:23
2
answers

How to do a select with dynamic columns for each like?

I'm doing a select for a report of calls by carrier and each column of quantity, I have a select compound and that should return me the amount of calls from each carrier. SELECT date(calldate) as 'Data', (select count(*) FROM cdr where dstchan...
asked by 11.08.2014 / 19:32
2
answers

How to do a record count for each day between one date and another?

I need to make an appointment, to return the number of registrations registered in EVERY DAY, between two dates. I'm using a MYSQL database, and I tried it here, but no form seemed to me correct.     
asked by 14.06.2016 / 16:45