Questions tagged as 'mysql'

1
answer

MYSQL query does not result

I have the following mysql query. SELECT (CASE WHEN s.id='1' THEN r.nombre ELSE 0 END) as sucursal1, (CASE WHEN s.id='2' THEN r.nombre ELSE 0 END) as sucursal2 FROM repuestos r INNER JOIN sucursales s on s.id = r.idsucursal WHERE r.codigo_ven...
asked by 06.08.2018 / 01:05
1
answer

Update record comparing different columns

What I'm trying to do is generate an SQL statement that finds me the rows that have repeated data, and at the same time in different columns. My table is something like this: ID FECHA UNO DOS TRES ESTADO -- ---------- --- --- -...
asked by 19.02.2018 / 03:57
1
answer

Error Notice: Undefined offset: 0 when getting PHP PDO data

By using the following function I get that error, the function is used to verify whether or not there is a string in DB , if it does not remove that error, but if it does not exist I get the error    "Notice: Undefined offset: 0" I...
asked by 01.03.2018 / 21:56
1
answer

how can I sort 2 columns per schedule as if it were one

I have 2 columns, the first is arrival_time, the second is pick_up, the question is the following, I need to sort the results depending on what type of service it is, if it is for example arrival (arrival) you have to select the schedule of the...
asked by 05.03.2018 / 02:09
1
answer

Correctly display characters encoded in style \ xe9 [duplicated]

I have a database in .csv format that I have exported to my MySQL database and whose records I want to visualize in a web using PHP. The problem is that some of the characters are encoded in the .csv file, for example \xe9 that corre...
asked by 29.12.2017 / 01:31
2
answers

Consultation of Inner Join to the same table

in advance thanks:) I have a small question, I must take the data from an id that is in the table using phalcon with mvc. The question is this, my table is this: |-----------|-----------|----------|--------------|----------------| | idus...
asked by 22.03.2018 / 22:43
2
answers

Password hash with postgres

Today I am facing a new challenge, implement security password with the PASSWORD HASH encryption method, I am working with postgress and php, but browsing the network I find information from md5, which, to this day , it is not safe anymore, and...
asked by 21.03.2018 / 18:29
1
answer

Error # 1241 MySQL subquery

How to create two subqueries in MySQL ? effectively and optimized. The current code throws me the error #1241 - Operando debe tener 1 columna(s) from the phpMyAdmin . The first subquery calculates the total number of availab...
asked by 16.01.2018 / 23:50
1
answer

Display an alert when inserting a duplicate product in the database

I have a question, I want to add a product to a database and when this product exists there is an alert that says "this product is already in the database", a question that I have achieved quite well except that when this warning comes out, is r...
asked by 04.04.2018 / 23:00
1
answer

problems with the primary key

good morning classmates I have an issue, what happens is that I am doing a database for my project in MySQL but I have a problem, in the requested tables and arealogistica in this area I have a single worker or person in charge of this area a...
asked by 30.03.2018 / 23:10