Questions tagged as 'mysql'

1
answer

Show available rooms according to two dates entered (ranges)

The idea is that entering the date of entry and date of departure; Show the available rooms by comparing with the reservation dates made. Assuming the following tables and data: CREATE TABLE Habitaciones ( habitacion_numero INT );...
asked by 20.12.2017 / 00:42
1
answer

Select all the clients whose name is repeated

To get all the clients out without repeating the names is very easy. SELECT distinct firstname FROM client And to get all the clients whose name is repeated more than once is not very complicated either. SELECT count(*), firstname FROM cl...
asked by 02.10.2017 / 17:15
1
answer

Laravel 5.4: I do not get data from Eloquent relationships

Using Laravel (with MySQL) I'm starting with Eloquent relationships. I try to get the related data but I do not get anything. My configuration is as follows: Migration providers: Schema::create('proveedores', function (Blueprint $table) {...
asked by 02.10.2017 / 03:28
1
answer

Show form depending on value in SESSION variable in PHP

I am trying to show a form depending on a value in the session variable, at the moment of starting the command I call several data and I store them in the session variable, one of these is an operator, but I want that if the variable has the ope...
asked by 26.09.2017 / 06:30
2
answers

How to update several fields of a table based on a subquery in MySQL?

What I basically want to do is, update precio_preparación of my table platillo , based on the total thrown by my subquery, which is stored in a temporary table. Practically what my temporary table shows is the following:...
asked by 06.03.2018 / 00:37
1
answer

Error in MYSQL and PHP query

Good afternoon. I do not know why this query is not done in PHP and Mysql This is the code of the form to send the content: <?php session_start(); if(!isset($_SESSION['usuario'])) { header('Location:auth'); exit(); } include 'conexion.ph...
asked by 15.11.2017 / 21:45
2
answers

Show image from the server folder and display it in a table with data from the MySQL database

I'm doing a project in which data is sent using a PHP form to a MariaDB database. I would like to suggest how to show the table with the data of the database as a report and show the image that was stored in the images folder. The scri...
asked by 16.08.2017 / 07:22
1
answer

I have this error in my view: "View's SELECT contains a subquery in the FROM clause" What do I do?

I want to convert the following query into a view, but I still get the error mentioned above. This is my query: SELECT C.id_pdmatriz, C.id_proveedor, C.Precio , x.Nombre , p.Nombre FROM ( SELECT MIN(A.Precio) AS Precio , A.id_pdmatriz FROM pro...
asked by 18.08.2017 / 17:37
3
answers

Build query according to CheckBox selected PHP / MySQL

I am trying to make a query according to the checkboxes that have been selected but I can not think of the best way to do it, I would like them to help me to build the code. Here's an example of how I'm doing it and if I select the...
asked by 18.08.2017 / 18:33
1
answer

Problem with relations in DATASET obtained from database

I'm having trouble getting a table with relationships. The problem arose that I had a complex query with many relationships, when asking the question they helped me to make the query that is efficient and fast, but when placing it in my program...
asked by 19.08.2017 / 18:51