Questions tagged as 'mysql'

2
answers

Doctrine: ManyToMany Relationship with Extra Fields

I have a many-to-many relationship between two tables: Products and Orders. Doctrine then generates a third table. Until then calm down. But I wanted to generate in this third table more fields (qtde and unit value at the time of purchase)...
asked by 26.05.2017 / 15:34
1
answer

dbExpress Migration to FireDAC

I'm migrating from a dbExpress system to FireDAC , the system is in three tiers >), I have changed components on the server side from SQLConnection to FDConnection , and SQLDataset to FDQuery , on the client side t...
asked by 13.10.2015 / 04:39
1
answer

Table does not appear in return Json

I'm trying to show a table on the return of my insert but I'm not getting it, the insert operation is correct as well as the confirmation message, but the table is not displayed, I have this: function GravaFase(event) { event.p...
asked by 04.08.2015 / 18:11
3
answers

How to select last records from related table?

I have the following tables: negociacoes , negociacao_contatos and negociacao_status and the following relationships: negociacoes hasMany negociacao_contatos negociacoes belongsTo negociacao_status In negociacao_stat...
asked by 25.06.2015 / 21:07
2
answers

Sort query in an interleaved way

I'm trying to list a particular product category. example. $consulta = $pdo->prepare("SELECT * FROM msg where tema = :tema;"); $s = 'mensagens-de-aniversario'; $consulta->bindParam(":tema", $s, PDO::PARAM_STR); $consulta->execute(); w...
asked by 14.06.2015 / 20:47
1
answer

MySQL JOIN with or without foreign key?

What is the difference between relating 2 tables using and not using a foreign key? Regarding performance, is it advisable to use foreign key to make the relationship? In what situation would it be indispensable and in what situation would...
asked by 28.06.2015 / 06:57
1
answer

I can not display the value of SQL

I'm trying to start a MySQL database connection and it works, but when I request that PHP display what it has there nothing appears. It's as if the connection to the BD had failed. <?php // definições de host, database, usuário e senha $s...
asked by 25.12.2014 / 21:44
2
answers

How to calculate the difference between values that are in the same column?

I wonder if there is any way to calculate the difference between values that are in the same column. For example: I have a table with 2 fields: date and balance. I need to add a new field containing the balance difference from one date to anothe...
asked by 09.12.2014 / 18:46
3
answers

How to make a left join using a where condition?

I have two tables: category -------- id | nome | imagem user_follow_category -------------------- id | from | to | date Note: The relationship of the two tables is given by category.id and user_follow_category.to . What I w...
asked by 27.01.2015 / 10:13
1
answer

How to filter a SELECT with n: m and bring all features?

I'm using n:m to create a system of attributes / characteristics for certain products, so I can reuse the same attributes for more than one product, the table looks something like: WhenIexecuteaSELECTlikethis:SELECTPROD.idASPRODUTO_ID,...
asked by 22.01.2015 / 23:33