Questions tagged as 'mysql'

2
answers

Select with date returning empty

Good afternoon,  What could be wrong in my query that is returning empty because of the date condition.  Follow query: SELECT imp_loja AS LOJA, imp_item AS ITEM, imp_desc AS DESCRICAO, imp_dias_giro AS DIAS_DE_G...
asked by 23.06.2016 / 20:57
2
answers

How to do an UPDATE using data from two different tables?

The table was once: Id dado1 dado2 01 1000 10 02 1234 12 03 9999 1 I had a cron task that ran the following update daily: UPDATE tabela1 SET dado1 = dado1 + dado2; Just to organize things, move dado2...
asked by 05.11.2016 / 00:11
1
answer

Error when doing email query in the bank

I am getting an error in NetBeans when doing a query in a SQL database that validates the user login from the email: package Modelo; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQL...
asked by 17.08.2017 / 12:25
3
answers

Update does not work

In my system there is a registration page and a page with a table of the information of the registered ones. This table has an edit button that links to an equal form on the registration page. What should happen: When you click the save...
asked by 05.09.2017 / 15:19
1
answer

where condition increasing

I have a table called users and I want to get some users according to the id so I am doing this: select * from usuarios where id=2; I just want to get several users with different ids, for example get users who have the id 2,8,10,11,20 at o...
asked by 27.02.2016 / 18:33
3
answers

How to get month and year from date?

How do I get the month and year for a date varchar on MySQL ? Example: 31/01/2013 31/02/2013 01/03/2013 01/01/2014 I want only dates 01/2013 in case of 31/01/2013     
asked by 11.08.2016 / 15:37
3
answers

How to store in a variable the number of rows found from a MySQL query

I have a Side Menu on my page and I want to display a warning text for the user, indicating when he has new messages and how many. For this I did the query in the DB and it correctly returns the number of records based on the query I set up....
asked by 27.07.2016 / 01:10
2
answers

Avoid duplicate MySql [duplicate]

Is it possible to avoid duplicates in mysql ? I had to search and nothing fits my case, whenever I try to duplicate it. I'm trying to import this into the table: INSERT INTO profiles (id, rep, gems, plevel) VALUES (id, 0, 100, 1...
asked by 12.09.2017 / 19:52
3
answers

How to convert 0 to null (Error inserting NULL into an INT field from a variable)

I'm editing this question to make it more didactic for other members, since there are only publications addressing this situation outside the community. I have a INT field with UNIQUE property that can have NULL value. The value th...
asked by 12.09.2017 / 19:14
3
answers

Login with validation system

In the login of my system, if the user has id and password registered the access is released. So far so good, but now I want to qualify this user in administrator (1) or simple user (0) so that when they log in, they are redirected to different...
asked by 29.09.2017 / 13:42