Questions tagged as 'mysql'

1
answer

MySQL - Select comparing fields from the same table

I know it must be simple, but I'm having trouble solving it. I have a table called "enterprise". In this table, I have 4 specific fields that store different ID's from other records in that same table. Example of the enterprise table.     The...
asked by 12.07.2017 / 15:42
3
answers

Logic for foreign key usage - user notes

I'm stuck with a foreign key usage problem. I can not find the logic for a system: The problem: the user gives a note to each question, each one being a table field, and in the end the average is calculated and inserted into the database. How...
asked by 06.07.2017 / 19:11
1
answer

Hibernate does not generate the database and the tables in mysql

I'm having problems with my project, about setting up the bank together with the tables. jul 06, 2017 7:19:21 PM org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.2.10.Final} jul 06, 2017 7:19:21 PM org.hibernate.cfg.Environ...
asked by 07.07.2017 / 00:30
1
answer

Alphabetical query

As you leave this query in alphabetical order, since the way it does not work, when I add a new element in the table it gets first in the query. <?php require ('../conexion.php'); $id_tipoUnidade = $_POST['id_tipoUnidade']; $q...
asked by 06.07.2017 / 23:00
1
answer

Field 'valueClick' does not have a default value

I have a problem, I add the news and I get the error 'Field' valueClick 'does not have a default value'. This "ValueClick" is a value that when clicking on the news link adds x money. Here is the code to add the news addNotícia.php <?ph...
asked by 09.07.2017 / 16:20
1
answer

What is the difference between primary key and index in mysql?

I wanted to know if there is any difference between primary key and index.     
asked by 28.02.2016 / 21:43
0
answers

Select in two fields of a table

Hello, I'm having a problem and I'd like to ask for help from you. It is as follows: I'm integrating a PHP system into the Wordpress Woocommerce plugin and I need to order some products from the database, so far so good. The problem starts wh...
asked by 05.07.2017 / 19:43
0
answers

Wordpress does not find Host Mysql

I'm trying to run WorPress locally on the Mac, this to work on the site and then promptly upload to the server. MySQL is installed on the MAC in /usr/local/mysql-5.7.17-macos10.12-x86_64/ is accessed via console and is in localhost: 3306....
asked by 19.07.2017 / 16:59
2
answers

MySQL - Multi SELECTs in a query

I need to get all the columns of a table and a custom column in the same query, I tried this way: SELECT (SELECT * FROM clans WHERE ID=1), (SELECT COUNT(*) FROM contas WHERE Clan=1) AS Membros; It is giving error by trying to get more than...
asked by 19.07.2017 / 01:09
1
answer

Select records under multiple conditions

Help in the code to select in MySQL. The conditions are: for records of the same 'net' and 'time', select the first record (id min) and another record if the 'AP' is different For different 'time' and 'net' records, the above condition is...
asked by 18.07.2017 / 22:37