Questions tagged as 'mysql'

1
answer

filter query with repeated values only show 1

Good morning I have this query $eventos_history_query = tep_db_query("select * from " . TABLE_HISTORIAL . " where numero_evento = '" . $customers['numero_evento'] . "' order by eventos"); while ($eventos_history = tep_db_fetch_array($ev...
asked by 04.10.2018 / 11:48
1
answer

Add data obtained mysqli to a multi array

I'm trying to add the data obtained from a select and order them to an array in PHP. I want to accommodate the array in this way: $array = array(noticias => array("1" => array ("titulo" => "Noticia 1", "autor" => "Pepe", "fecha"...
asked by 06.08.2018 / 23:38
3
answers

How to solve this MySQL query

List the name of the clients who have traveled in all the cars. I have 4 tables, auto, driver, client and trip, the only one with foreing key is trip that acquires the driver, client and travel primary That's how I did it but it's bad...
asked by 15.07.2018 / 23:43
1
answer

How to nest independent 'select'?

I have the following table with information: What I need to show is this: I try with this code, but I duplicate the data: SELECT * FROM (SELECT Codigo AS LYC FROM Requerimi...
asked by 10.08.2018 / 00:05
2
answers

Declare output variable. MySql stored procedure

DELIMITER $$ CREATE PROCEDURE 'capturar_consecutivo'(numero int) RETURNS int BEGIN DECLARE num int DEFAULT 0; SET num = ( SELECT * FROM consecutivo where consecutivo.numero=numero ); RETURN num END $$ DELIMITER ; I'm trying to crea...
asked by 30.08.2018 / 16:35
1
answer

Form to upload a document to my server

I'm starting with php and I'm already acquiring the basic knowledge, but I just faced a wall when trying to make a form with a field to upload a document and other input to put a number, and that when uploading the document, be renown with the n...
asked by 05.01.2018 / 13:45
1
answer

Comparison in several SQL tables

I need to perform a query in SQL validating the following: I have a parent table that is called elemento and has a field tipoelemento , and two child tables equipo_computo and equipo red , with the fields tipoequi...
asked by 27.12.2017 / 16:28
1
answer

MYSQL How do I make a trigger to update stock after canceling an invoice?

I want that after canceling a record in the tblingreso table the corresponding stock in the articles table is updated (the stock is subtracted): UPDATE tblingreso SET estado='Anulado' WHERE idingreso='1'; I have my table tblingreso with...
asked by 11.12.2017 / 07:31
2
answers

disordered months in mysql

my question is because the months in the database are disorderly and I want to know why they come out so I leave the code sql SELECT mes_traslado FROM formulario_precebo WHERE año_destete = 2017 GROUP BY mes_traslado; and the result it gi...
asked by 04.04.2018 / 16:46
2
answers

Problem receiving data on Android with JSON, PHP and MySQL

I am developing an application for a restaurant control, it should be noted that I am relatively new to this, and most of what I do is with online consultations. This is the problem, I have this PHP Script in which I receive a variable of NA...
asked by 24.09.2017 / 03:49