Questions tagged as 'mysql'

1
answer

How to remove or hide duplicate records from two detail tables with a master table in Mysql?

I have the following tables: CREATE TABLE 'COMPRAS' ( 'codigo' CHAR(10) CHARACTER SET utf8 NOT NULL, 'periodo' SMALLINT(4) NOT NULL DEFAULT '0', 'mes' SMALLINT(2) NOT NULL, 'numero_indicador' INT(12) NOT NULL DEFAUL...
asked by 18.11.2016 / 01:10
2
answers

Can MySQL format AUTO_INCREMENT?

I have a table in which the primary key is in 'BCB001' format, I would like to know if there is any way to format AUTO_INCREMENT so that I can fill in the field I need.     
asked by 13.11.2016 / 17:20
1
answer

Problems when inserting data into a table with several foreign keys

Good, I am trying to insert data in all the tables of my database, especially the one of student that depends on three foreign keys already obtained when executing the previous querys. I will leave all the queries, but I would like them to detai...
asked by 20.11.2016 / 05:04
1
answer

MySql query from a page on asp.net

I'm trying to implement this code snippet public List<int> Temperatura() { List<int> Datos = null; string connStr = "server=localhost;user=root;database=sensores;port=3306;password=123456;";...
asked by 15.11.2016 / 04:46
1
answer

Detail with SQL - UNION & ORDER BY

I have the following query SELECT matricula_veh as 'Identificacion', concat(marca_veh,' ',modelo_veh) as 'InfoName', 'Vehiculo' KindData FROM vehiculos UNION SELECT id_per as 'Identificacion', concat(nom_per,' ',ap...
asked by 19.10.2016 / 01:10
1
answer

Problem with SERVLET and JSP

I have a list of orders, when I click on one I see the detail of that order and I have a button to mark it as DELIVERED. I pass the id of the order from a jsp to a servlet and there I do the update (until here it works well), but after the updat...
asked by 09.11.2016 / 14:23
2
answers

Form does not save data in database

I have a simple system to store data in a database through the following form: Conexion.php <?php $host="localhost"; $usua="root"; $pass=""; $base="yerson"; //base de datos// $cone = new mysqli($host,$usua,$pass,$base); if ($cone->co...
asked by 10.11.2016 / 00:40
1
answer

INSERT INTO ... SELECT ... ON DUPLICATE KEY

I need to know what could be wrong with this query: INSERT INTO 'turnos_enviados'('rut','hora_envio', 'turnos') SELECT "12345678", 'hora_envio'+1, "string cualquiera" FROM 'turnos_enviados' ORDER BY 'hora_envio' ASC LIMIT 1 ON DUPLICATE KEY UP...
asked by 08.11.2016 / 04:34
1
answer

How to give privileges to a user to execute all the procedures?

In Mysql, as I can give permissions for a user to execute all the procedures, I found: GRANT EXECUTE ON PROCEDURE miBD.miProcedure TO 'USER'@'localhost'; As you can see you can only give permission to one procedure but not all, how to give...
asked by 18.10.2016 / 17:32
2
answers

Duplicate results with INNER JOIN

I come with a problem with PHP and MYSQL. I tell you: I'm creating as a followers system, and I had it finished and I made it work, but the code was not the best we could say, because ... well, this was the code I had before: $followers = "SEL...
asked by 13.10.2016 / 02:52