Questions tagged as 'mysql'

1
answer

Problem with my database

I am trying to create a database for a school project and I get the following error: (errno: 150 "Foreign key constraint is incorrectly formed") Please help, the code is as follows: CREATE SCHEMA IF NOT EXISTS 'bibliotecaFastDev' DEFAULT...
asked by 26.05.2018 / 06:33
1
answer

null values in mysql

I have a month table, an office table and another table detail_despacho, what I need is to be able to get the total of products sold for each month but with that I need that if in any month there is no registered office that still shows me the m...
asked by 26.05.2018 / 17:23
1
answer

How can I perform the following query with Query Builder Laravel 5.5

I have the following query in mysql. SELECT COUNT(*) FROM (select SUM(tabla1.campo1) from 'tabla1' inner join 'tabla2' on 'tabla1'.'tabla1_id' = 'tabla2'.'tabla2_id' where 'tabla1'.'campo1' <> 0 group by LOWER(tabla1.campo2)) tabla_gen...
asked by 24.05.2018 / 16:42
1
answer

Problem with mysql stored procedure call

I have a problem calling several times in a row (within a while) to a procedure (with the CALL nameProcedure (parameter)) from php on my website. This is the code of the procedure: BEGIN SELECT @estado := estade, @subestado := subest...
asked by 23.05.2018 / 10:01
2
answers

Clear data from 2 MySQL tables

I need to delete data from two tables whenever they are older than a given date. The tables are the following: Table: reservation | id | contrato_id | fecha | ... Table: contract | id | tipo | precio_total | ... Are related by t...
asked by 23.05.2018 / 14:31
1
answer

Subtract hours from a datetime in MySQL

I have a field which is a datetime, this field returns the following date / time: 2018-05-16 14:37:45 What I would like is to be able to subtract 5 hours from that date and make it look like this: 2018-05-16 09:37:45 I could achieve th...
asked by 16.05.2018 / 15:51
1
answer

UPDATE MYSQL WITH PHP

I'm trying to do an update in mysql from php, but I'm finding it difficult, since I want to collect the values of a form in which their names are put with the name of the fields of the columns, I do not know how to explain Well, I pass code to y...
asked by 08.05.2018 / 11:38
1
answer

Problems showing images [duplicate]

I have this code that prints images from the server, but I can only see it on the server and on the internet explorer only: <img src='file://192.168.10.129/sapshared/FOTOS/KennedyDB/$row[PicturName]' height = '100' width = '100' &g...
asked by 09.05.2018 / 02:09
1
answer

Delete documents automatically

currently I have a doubt, I have a small server which I upload documents using a form, this is uploaded, is the record of the time which has been uploaded and when it should be deleted, I would like to know if there is any simple way to delete t...
asked by 09.05.2018 / 16:30
2
answers

Fix database and php security problem

I am new here and I have a problem with my page, it turns out that it has user registration, session and administrator, if I enter with my admin account, I can delete or edit users, the problem is that, when entering admin, it appears a section...
asked by 20.05.2018 / 18:02