Questions tagged as 'mysql'

1
answer

How to do the select of two tables in mysql? [duplicate]

I know this should be an easy question, but I'm a beginner: I have these 3 tables in my bank: In this case, the purchased table is where the cpf of the user who purchased the course is stored and saves the course id. I think that's...
asked by 06.02.2018 / 23:09
1
answer

How to do an echo of a select DATEDIFF?

I made the following code $data_restante = "SELECT DATEDIFF(CURTIME(),$data) AS date"; $result_data_res = mysqli_query($conn, $data_restante); $dado_data_res = mysqli_fetch_assoc($result_data_res); echo $dado_data_res['date']; But it does n...
asked by 15.02.2018 / 00:22
3
answers

Find two MySQL tables and select rows with one element in common

How can I use a foreach for this situation? I would be selecting an element of the tabela dois - event - and for each event, get the tabela um data that also have the same event in its structure. By the way, when aski...
asked by 15.02.2018 / 02:28
1
answer

Why is not pulling the variable GET id? [closed]

index.php <table border="0" width="100%"> <a href="insere.php">Adicionar</a> <tr> <th>Nome:</th> <th>E-mail:</th> <th>Açoes:</th...
asked by 05.02.2018 / 14:09
1
answer

Remove a configuration from a mysql column

I have a mysql column that has a key with value MUL , how to remove this setting from the command line? My table has the following schema: +-----------------+--------------+------+-----+-------------------+---------------------...
asked by 05.02.2018 / 18:34
1
answer

How to do OnClick action in Select Option [closed]

I need to do an onclick action on each option of a select with a different link according to each id, but it is not working. $label .= "<select size=\"1\" name=\"modulo\" class='form-control'"; $label .= "<option value=\"0\" selected=\"...
asked by 05.02.2018 / 12:54
1
answer

collect tables from one mysql database and insert into another

Hello! I have a question, is there a way to get information from one mysql database and insert into another one with tables having names? example: I want all the inserts of the bank 1 table name and insert into the bank 2 table username. ho...
asked by 22.02.2018 / 21:02
1
answer

Get average in mysql with different conditions

I am putting together a graph containing the number of CHATS that were answered at a given time, eg:    1-30s - > 20 chats answered       31-60s - > 66 chats answered       60-120s - > 4 chats answered I'm confused on how to re...
asked by 12.03.2018 / 02:15
1
answer

SELECT similar to the "INNER JOIN" cell in the cell of the record?

I have little knowledge about SQL and would like to know if it is possible to do a SELECT on the same record (row), and for each cell value bring the corresponding record from a second table. Something similar to INNER JOIN, I believe. Exampl...
asked by 04.03.2018 / 18:49
1
answer

Date expiring from the datetime (datetime) - MYSQL

The field is of type datetime, such as displaying the date for here 30 days from the date you registered, eg: <?php // 'data_cad' = '2018-03-01 01:52:00' $instrucao = "SELECT 'user_id', 'status',...
asked by 02.02.2018 / 07:05