Questions tagged as 'mysql'

1
answer

Help with the update in mysql

I have a code in php and mysql to edit a ticket but when I edit it with the new values it tells me the message as if it had been inserted but it does not enter the database the ajax code to edit <?php include('is_logged.php'); if (empty(...
asked by 04.10.2017 / 15:13
1
answer

Problem with classifying data in SQL

SELECT libro.titulo AS "Titulo Libro", sum(ventas.cantidad) AS "Cantidad_Comprada" FROM libro left JOIN ventas ON libro.id = ventas.id_libro GROUP BY libro.titulo I just want to show those elements that have a quantity of sum (sales.quant...
asked by 03.10.2017 / 16:56
2
answers

process data from php-mysql to json

I have a series of php, ajax and js files to be able to process my information obtained from my database (MySQL) and at the same time I want to send them to a modal using a .js So far I can get my result from my query using a var_dump:...
asked by 05.01.2018 / 14:53
1
answer

How to insert data in a single column?

I want to insert in a table column T_tiphab but I can not tell me:    ERROR 1452 (23000): Can not add or update a child row: a foreign key constraint fails ( reservas . T_tiphab , CONSTRAINT T_tiphab_ibfk_1 FOREIGN K...
asked by 05.01.2018 / 00:34
2
answers

Percentage of sales for the current month

I want to get the percentage of sales for the month of the current year. In other words, I sum the total sales of the month of each month and I divide them by the total sales of the year. SELECT *, sum(total_venta) as total_venta FROM...
asked by 01.10.2017 / 00:11
2
answers

It is saved in the db but the DOM is not updated

PHP <?php $servername = "localhost"; $username = "root"; $password = ""; $db = "data_estudiantes"; // Create connection $conn = new mysqli($servername, $username, $password, $db); // Check connection if ($conn->connect_errno) {...
asked by 27.09.2017 / 04:56
1
answer

How can I see the alert messages in PHP before I redirect to another page?

I want to show what happened when saving an image in the database and then redirect to another page with a header, and I can not see the alert messages indicating if the image was saved. This is my code: <?php require 'conexion.php';...
asked by 26.09.2017 / 00:26
1
answer

Replace one image with another PHP and MYSQLI

I have my code to edit images in my database, but when replacing the image in the folder or the path where it is saved does not replace them, but adds a new one. I leave image below: The image that is underlined in yellow is the one I w...
asked by 31.10.2017 / 21:07
1
answer

Syntax error with case in mysql using SP

Well from phpMyAdmin I'm doing a crud with case, and well he tells me that there is syntax error nothing else I do not see something bad. My code is this: create PROCEDURE usuarioXY (in _idUser int(11), in _usuario char(50), in _consetrasen...
asked by 20.09.2017 / 19:26
1
answer

Get the difference in hours of two DateTime Java Server Faces?

Good morning my query is the following in two Datetime I capture a start date and a final date, at the time of saving my final date in the database I need you to save me a data type Float with the difference of those two dates in hours I make a...
asked by 08.09.2017 / 13:01