Questions tagged as 'mysql'

5
answers

Login system with PHP [closed]

Hello, I need to do an administrative area, and obviously I need a login system and password. I know there are already questions here, but I fear they are outdated. I want a way inside the simple and safe possible. I also do not want anyone to d...
asked by 07.12.2015 / 18:46
3
answers

Query INSERT with WHERE condition

How can I make an insert with a where condition? I have the following query: INSERT INTO 'registro'('id', 'username') values ('','USER_1'), ('','USER_2'), ('','USER_3') It will add a new user to the table record. Except that I need it...
asked by 12.04.2018 / 15:59
4
answers

Count equal records with SELECT DISTINCT and COUNT

How do I count the same results and add the amount up front? For example: Currently the records in my table look like this: Id | Nome ------------ 0 | Teste 1 | Teste 2 | Teste I want to give DISTINCT to them and leave...
asked by 30.09.2014 / 22:28
1
answer

What are the recommended values for MySQL database (id, user, password and email)?

I created a user table with the following values: Tipo = 'MyISAM' ID = 'int, PRIMARY, AI'; Usuário = 'varchar, 16'; Senha = 'varchar, 16'; Email = 'varchar, 100'; Are these values recommended? Insurance?     
asked by 24.05.2014 / 20:46
3
answers

How to correctly do this condition?

I made this condition so that if the person searches for the name andrey will execute a require, otherwise it will not display, so any name that I put in the search field is bringing the require, so here's my code: if ($resultados->num_rows...
asked by 09.10.2017 / 19:54
2
answers

Mysql returning "Group By" error after upgrade to version 5.7 [duplicate]

I had a certain MYSQL query that was working correctly. This is the query: SELECT *, count(*) as count FROM 'post_hashtags' WHERE 'created_at' BETWEEN ? AND ? AND (SELECT count(*) AS 'aggregate' FROM 'post' WHERE 'post'.'id' = post...
asked by 10.11.2016 / 13:40
3
answers

Viability to create 200 columns in database [closed]

I am planning software, which is a test of 200 questions where each question can only have 3 choices and select only one, and each question belongs to a class type (eg question 5 belongs to class B , are classes from A to J) and I need to save t...
asked by 28.03.2016 / 20:35
3
answers

Function does not return value

Colleagues ... I have a method that brings the results of a table. So far so good. What is puzzling me is that after I changed the server, the structure of this method is the same for two other results and works perfectly, but when creating a...
asked by 11.05.2015 / 18:02
3
answers

Prevent data from appearing in MYSQL search

I have a table consisting of the following columns, ID , Produto , Compra , Venda and Resultado . I know the syntax for selecting the values I want, eg Select * From tabela_exemplo where Produto = '030'; How...
asked by 13.09.2017 / 15:30
2
answers

A MySQL query, with 'crases' vs without

With quotes is the query safer or less? $Query = "Select * from 'tabela' WHERE 'id' = '1'"; vs $Query = "Select * from tabela WHERE id = 1";     
asked by 08.08.2015 / 20:17