Questions tagged as 'mysql'

1
answer

Arduino + PHP + MySQL

I do not know about PHP, so I'm having some doubts ... I'm trying to implement a connection of the three systems mentioned in the title. The idea is to capture two sensor values and send them to php and then to mysql. But before that, I'm having...
asked by 09.09.2018 / 22:10
3
answers

How to format an array php

I am doing a SQL query in my model and controller , I am printing the array values. The view looks like this: Array ( [campo1] => 98 [campo2] => SOLO [soma] => 1 ) Array ( [campo1] => 92 [campo2] => DARTH [soma] => 11...
asked by 10.09.2018 / 22:21
1
answer

Get value from the right set with 'ambiguous' fields

I'm doing the following query to my database: $escalacoes = 'SELECT * FROM escalacoes AS e JOIN jogador_rodada AS jr ON e.id_jogador = jr.id_jogador WHERE e.rodada = ('.$rodada_atual.' - 0) AND jr.rodada = '.$rodada_atual; $escalacoes...
asked by 08.07.2018 / 00:42
1
answer

How to perform this Select?

I need to relate data according to the last item found in the user table, for example: Table_A: +----------------+-------------+ | user_id | title_id | +----------------+-------------+ | 154138746 | 123 | +-----------...
asked by 15.07.2018 / 19:05
1
answer

How to count how many fields are empty in the mysql table

I have a land register table with several columns (some of them: id, address, city, proposal, etc.) and would like to count how many fields are empty. For example, the table has a total of 44 columns, if you only have 20 fields filled in, the...
asked by 16.07.2018 / 16:31
1
answer

Help on how to join these two queries MySql

   I found the UNION ALL option but the results are shown below   on the other, I would like you to create a column for each discipline I have these two queries and I would like to join the two, the difference between them is that one has a...
asked by 20.07.2018 / 19:11
1
answer

Encapsulation of random amounts - is it possible?

I'm trying to get php to send a response to the informational javaScript file, in which javaScript places a request for php in ajax, and php sends amount of information in random amount, php pulls from the database all records and will answer th...
asked by 25.06.2018 / 16:37
1
answer

Best cardinality for a table with many relationships

Well, I have a cash flow table , this table can be related to a process, order, account receivable, payable ... among several other tables that relate to and which can result in a posting in the box, the problem is when creating the relationshi...
asked by 08.01.2015 / 21:53
2
answers

How to write SELECT result?

I need to insert data into a table A, but I have an unknown data and I need to search it in table B. So, I need to do a SELECT on table B and save it for later insertion into table A. I have achieved the expected result, but it is a pallia...
asked by 09.01.2015 / 19:43
1
answer

How to randomly select a row from each group in MySQL

Suppose I have a table like this: item | group -------+-------- item a | group z item b | group y item c | group y item d | group x item e | group z item f | group x And now I want to randomly select a single item to represent each group,...
asked by 05.09.2018 / 03:15