Questions tagged as 'mysql'

1
answer

Different variable value in sub-select

I have the following query: SET @VAR = 'N'; SELECT 'TESTE1','OI',@VAR := 'S' AS T UNION ALL SELECT 'TESTE2','OI',@VAR AS T UNION ALL SELECT * FROM ( SELECT 'TESTE3','OI',@VAR AS T ) AS TAB UNION ALL SELECT 'TESTE4','OI',@VAR AS T Can a...
asked by 01.11.2017 / 20:50
2
answers

How to recover the last payment? [duplicate]

I have the following table in my bank: "financeiro financeiro_id INT AUTO_INCREMENT, financeiro_pagamento DATE, financeiro_pid INT, financeiro_valor INT, "; In this table I record the payments that my system receives, then...
asked by 02.11.2017 / 18:03
2
answers

SELECT AND UPDATE - Undefined index when submitting form

Hello I am building a content manager and I have a page where I return the results of the chosen country, so that I can then update each field. By choosing each country on the Paises.php page, I send the respective parameter to the edit pa...
asked by 11.09.2017 / 19:46
1
answer

Add MySQL Connector to the install package

I have a Windows Forms that connects to a remote MySQL database (it's on a server). Basically, all it does is read data from a table, neither write nor anything. I'm using the Entity Framework and my project has the following dependencies f...
asked by 14.09.2017 / 15:45
1
answer

Stop database return - Mysql / PHP

I have a problem to finalize a project, I need to return the records of a database table, but in some registers, it has a data stored differently, so I need to stop the execution. I could not find the solution so far. What I need is to show a...
asked by 11.07.2017 / 23:16
2
answers

Inclusion of data by the operator

I build the code below but when I enter the data the system has an error. package tarefaBD; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;...
asked by 20.05.2017 / 21:42
1
answer

How to show result via ajax and jquery without refresh on page

I tried to implement an Ajax call on a project and I can not identify the error. I have a form for posting status and I would like it as soon as I post something it does not refresh on the page and rather it shows the result, then in a div. I...
asked by 16.07.2017 / 08:03
1
answer

How to fetch data from one table using reference from others?

I'll illustrate with one simple thing ... I have a 'products' table that has columns, id, product_name, value. I have another table 'users' columns, id, name. And another table 'user purchases' id, id_user, product_id, product_name, this thir...
asked by 26.09.2017 / 16:31
2
answers

How do I put a select within the while?

Use Sublime text, Mysql Workbench and Xampp. I made an inner join in the select below, in a table called Organizacoes.Copia. In this table there is a field called "id" and I need it to appear in this Php code. I saw several videos and exam...
asked by 07.05.2018 / 14:22
1
answer

mysql and php - subtract the last two records from the same column and divide by the last record from another column

I have a carro_log table that keeps the update history of another table. id kilometragem combustivel dt_atualização 1 200 45 2017-05-03 2 400 35 2017-05-03 1 150 38...
asked by 04.05.2017 / 07:33