Questions tagged as 'mysql'

1
answer

JPA @ManyToMany with additional column

I am trying to connect two tables with a many to many relationship but, in the third table that relates them, apart from the id of each of the other two tables, there is a third field and I do not know how to indicate this third field. I have...
asked by 30.07.2018 / 00:09
0
answers

compare current field with the following to perform a subquery in MYSQL

I have a query, in it, I have a subquery, and I only want to execute the subquery always when the current code field does not repeat with the next. I will show a sql pseudocode so that I understand what I want to do, especially in the CASE:...
asked by 30.07.2018 / 05:34
1
answer

Report php and Mysql with records of the same client

Good evening I hope and you can help me I have a query in mysql that displays the data in the following way but I need the records to be this way I'm doing the report with fpdf I have the following $sql1 ="select a.estudiante...
asked by 30.07.2018 / 06:27
2
answers

MySQL: Get complete orders with a subset of products

The problem we have is the following. We have a shop_orders database with orders placed by customers: id | user_id 1 | 1 On the other hand we have the shop_order_products table, which contains the products that each order contains, where t...
asked by 11.04.2017 / 08:56
2
answers

how to select data between a range

As I can build the SELECT, to select from a table the data that are in the middle of a sequence, I need to select from the column code, the data in the sequence are between the smallest code, ie 001, and the last Bone 005, knowing that 005 could...
asked by 29.07.2018 / 01:32
3
answers

Create PDO query with the values of an array

I am trying to generate a MySQL query with the data I have captured in a array . array(2) { ["area1"] => array(3) { [0] => string(5) "item1" [1] => string(5) "item2" [2] => string(5) "item...
asked by 04.04.2017 / 18:27
1
answer

Docker Compose container in Nginx does not route correctly

I'm getting started on this Docker container and following a tutorial, I created a docker-compose.yml file to have a web application server based on Nginx , PHP7-fpm , MySQL and Laravel (all in their latest versions). It works but no...
asked by 19.03.2017 / 15:13
3
answers

Data not inserted with query prepared mysql-php

I am making a loan system in which a teacher will request a loan, which will record his identification number, the plate or serial number of the item he requested, the current date and the administrator who lent him the item at that moment, who...
asked by 06.03.2017 / 21:06
2
answers

Display query result differently SQL

I have the following query: SELECT pr_products.product AS PRODUCT, pr_varieties.variety AS VARIETY, pr_grades.GRADE, SUM(pf_harvest.quantity) AS QUANTITY FROM pf_harvest INNER JOIN pf_performance ON pf_performance.id = pf_harvest.id_performanc...
asked by 29.03.2017 / 22:17
3
answers

Subtract two fields from a table in PHP mysql?

I want to calculate the rest of a driver, and for this I have the following table: What I want to do is to calculate for each driver, the largest rest expressed in Hours. For this I have to do the subtraction between the departure an...
asked by 20.02.2017 / 12:26