Questions tagged as 'mysql'

4
answers

Error inserting data with php and mysql

I have the following problem when trying to enter data to my bd these are the codes: <html lang="en"> <head> <meta charset="UTF-8"> <title> Creacion de Usuario Operador </title> <link href="estilos.css" rel="st...
asked by 20.07.2017 / 11:11
3
answers

Migrate my database from mysql to laravel

I am new with Laravel and I am seeing if there is a way to pass the database that I have in mysql, to laravel to be able to work with them. I've already tried: Modify the .env. Modify config/database.php . But what I find is th...
asked by 18.11.2016 / 16:55
2
answers

Doubt in MySQL query

Good morning I have a doubt in this MySQL query. As a first condition I want the id_gral to be equal to the one I send, second condition that is from a range of dates, third condition that the dst is equal to the one I send and finally that from...
asked by 26.10.2018 / 17:54
2
answers

lastInsertId () from PDO or SELECT MAX ('id') from MySQL

I am presented with the following question at the moment of wanting to insert in two tables, and this is what would be the best or most optimal at the moment of retrieving the last inserted id from a table so that later it will be inserted in an...
asked by 16.09.2018 / 02:59
2
answers

Search and Delete duplicate MYSQL records

Well, my situation is as follows, I have a rather large database, and there are a lot of duplicate records (there are actually many that are repeated more than twice but I do not know how to call that). What I'm looking for is a query to h...
asked by 20.03.2018 / 01:41
2
answers

Multitasking queries in MySQL

I am doing a query with MySQL where I have some establishments and in another table I have the comments of the establishment. This is the query I do: SELECT * FROM establecimientos INNER JOIN comentarios ON establecimientos.id = comentarios...
asked by 02.04.2018 / 06:28
2
answers

My MySQL query does not work when I use a%

I have the following query: SELECT calldate, src, dst FROM cdr WHERE src != '442%' AND src != '044%' LIMIT 50; If you run it, but I do not know if it's really well done. What I need to do is bring the marked data where the condition is...
asked by 04.07.2018 / 21:20
3
answers

How to alias each resulting row of UNION in MySQL?

Having the following table: Productos _______________ id_producto nombre_producto tipo_especial fecha_inclusion    I would like to obtain the product account conditioning whether or not it is a type   special, by aliasing each resulting row...
asked by 12.03.2018 / 15:14
2
answers

Select min +1 mysql

I'm trying to get the first free code between two values and I do not know what I'm doing wrong that always gives me 2 when there are numbers above 2 . this is the code I'm using: SELECT MIN('Ean')+1 as prox_ean_libre FROM 'Cod...
asked by 27.11.2017 / 15:35
2
answers

Problem creating user

I'm trying to create a user using this grant command: GRANT ALL ON usuario.* to usuario@localhost IDENTIFIED BY 'contrasena'; The problem is that it does not recognize the end of the quotes, so it recognizes that it has not finished executi...
asked by 14.04.2018 / 14:52