Questions tagged as 'mysql'

1
answer

How to validate a record in a trigger?

To avoid doing code validation, I would like mysql to insert a detail of a loan to create a trigger to validate if cantidad de artículos in tabla artículos is greater than zero , let me update the table articles otherwise n...
asked by 10.05.2018 / 23:47
1
answer

Error subtracting two dates

I am doing this function to subtract the date of an unpaid fine, from that date to the current date. But I get an error DELIMITER $$ DROP FUNCTION IF EXISTS finesNotPayed $$ CREATE FUNCTION finesNotPayed (fineDate INTEGER) RETURNS INTEGER BEGI...
asked by 09.05.2018 / 22:39
1
answer

Query HAVING SUM () in HQL Query

I would like to use the following query that you make in MySQL: SELECT * FROM bdcsd.insumo GROUP BY bdcsd.insumo.Nombre_Insumo HAVING SUM(bdcsd.insumo.Stock_Actual) <= bdcsd.insumo.PDP; In a java class using Hibernate's HQL Query method...
asked by 19.07.2018 / 17:48
2
answers

SQL query two row of a table in a bidding system

I would like to know how I could add to a query, that it also see data from another row of the same table, I have the "USERS" TABLE with rows ID, USER, WEB <?php $resusuario=mysql_query("SELECT * FROM usuario WHERE usuario = '".$fs['usuar...
asked by 15.10.2018 / 03:25
2
answers

foreign wrongly entered

I have been with this error for hours: Error Code: 1005. Can not create table prueba . montaje (errno: 150 "Foreign key constraint is incorrectly formed") Can someone tell me what I have wrong with my code? CREATE TABLE Mo...
asked by 14.10.2018 / 04:01
1
answer

How to show the records that I am uploading in the database in the table html?

This is the code in php and html that I have works well, saves the records that I charge, but what it does not do is show the row that I just loaded on the page after I click on the "load" button I have to reload the page and it gives me the war...
asked by 10.07.2018 / 17:57
1
answer

How to perform an sql query with the LIKE clause using queries prepared in php?

I would like to know how I can perform a query prepare in mysql using the LIKE clause to filter $stmt = $this->db->prepare("SELECT * FROM ARTICULOS WHERE DESARROLLO LIKE :search "); $search_ = '%'.$name.'%'; $stmt->bin...
asked by 26.04.2018 / 15:35
1
answer

Error using PDO [closed]

The error is as follows:    Call to undefined method PDOStatement :: fecth () in /home/ubuntu/workspace/redsocial/classes/gestores/ManagerSeguidor.php on line 73 Call Stack: 0.0004 236840 1. {main} () / home / ubuntu / workspace / redsocial /...
asked by 06.05.2018 / 13:48
2
answers

connection to java with mysql

Actually not so good JAJA, I have a problem with the connection from java to mysql and import the library the jar even though I made the connection and it tells me that the connection is not established. I show you the connection code packa...
asked by 19.04.2018 / 17:38
1
answer

How to count names of dynamic registers in MySQL?

I have the following query SELECT ROOM_TYPE.type FROM ROOM_TYPE INNER JOIN ROOM ON ROOM.id_room_type = ROOM_TYPE.id that throws me the next result | TYPE | ---------- |sencilla | --------- |sencilla | ---------...
asked by 18.04.2018 / 17:46