Questions tagged as 'mysql'

1
answer

Select checkboxes that come from the database in the edit form

Hello, I have a user editing form that has some chekbox with names of cities that should be selected when the form is opened. Well, I'm selecting in the database the cities the user being edited has access to and making a comparison in the &...
asked by 13.07.2016 / 19:37
1
answer

Adding specific keys obtained in SQL query - PHP

I have a sql query that returns all the fields in a table: $registro = mysqli_query($con, "SELECT * FROM agenda ORDER BY procedimento LIMIT $limit, $nroLotes"); My question is, if it is possible, through this query, to add the values of a c...
asked by 18.07.2016 / 05:09
1
answer

How to do a 'select multiple' start with the first option already checked PHP Mysql

Here's my component: $query_menu = mysql_query("SELECT rm_id AS FUNCAO, rm_desc AS DESCRICAO, rm_obs AS OBSERVACAO, rm_status AS STATUS FROM radios_menu WHERE rm_statu...
asked by 18.07.2016 / 17:39
1
answer

MySQL error "Can not add foreign key constraint"

I'm starting in the SQL language. I'm having the following error: Table 'linces.controlos' doesn't exist I have not found the solution yet, can anyone help? Drop Database if Exists Linces; Create Database Linces; Use Linces; Create Table...
asked by 31.05.2016 / 01:32
1
answer

How do I sum all the values of a PHP column

asked by 28.07.2016 / 00:18
1
answer

Get Only a Query Registry Ranking Number

How can I get the Ranking of a record in the table with just a Query (even if it has a Subquery)? For example, I did this below: SELECT a.id_concessionaria, a.avscore, @rank := @rank + 1 AS ranking FROM ( SELECT...
asked by 27.07.2016 / 15:28
1
answer

where affecting only one field in select

Good morning, how do I make my clause affect only one (1) field in my search? For example: $query = DB::table('proventosdesc as proven') ->join('calculo_rh as calc', 'proven.pessoaId', '=', 'calc.pessoaId') ->join...
asked by 24.05.2016 / 14:21
1
answer

Bring Records That Do not Have - 3rd Table

Scenario, four tables. TABELA A | TABELA B | TABELA C | TABELA_D ID_A ID_B ID_A ID_B ID_D ID_D DESC 1 10 1 10 1 1 PEÇAS...
asked by 25.05.2016 / 21:01
1
answer

Problem with mysql

I would like to know what I can do for mysql to recognize the "+" character, as it shows a part of my site the name with "+" and when I make a request on $_GET I need to retrieve this name by url but he does not recognize wh...
asked by 25.05.2016 / 16:50
1
answer

MYSQL: Find subsequences in a sequence and group by ID

I have a table with the following result: ------------------ |seq | ID | ------------------ | 1 | 12345 | | 2 | 12345 | | 3 | 12345 | | 4 | 12345 | | 8 | 12345 | | 9 | 54321 | | 10 | 54321 | | 11 | 54...
asked by 27.05.2016 / 17:04