Questions tagged as 'mysql'

1
answer

json php query with duplicate results

The result of my php query is shown as follows: the data is repeated in each query. <?php header('Content-type: text/html; charset=UTF-8'); include('functions.php'); $sql = "SELECT * FRO...
asked by 25.09.2018 / 18:54
1
answer

Error saving json data in MySQL

I'm trying to store this data JSON : { "ticker": { "base": "ETH", "target": "USD", "price": "689.18009232", "volume": "234831.85174911", "change": "1.48138601" }, "timestamp": 1525308422,...
asked by 03.05.2018 / 17:18
1
answer

How to select all the last records that have a column with the same value?

I have a table where I insert an id from another table ('Idstock') and I wanted to select all the last records that have an identical id in that column For example if I have 6 records the columns would be: 'idMov' / 'Idstock',/'Descripcion'...
asked by 08.05.2018 / 17:50
1
answer

Store query in array

Very good to everyone. I need to solve something that I can not give with it. I have a mysql query where I extract the income totals for each month of the year 2018. $sql_g=mysqli_query($con, "SELECT MONTH(fecha_factura) AS mes, SUM(total_vent...
asked by 05.05.2018 / 18:58
1
answer

Join in laravel

I have my in my controller: $habitaciones = DB::table('habitaciones') ->join('tipo_habitaciones', 'habitaciones.id_tipo', '=', 'tipo_habitaciones.id') ->select('habitaciones.*', 'habitaciones.id', 'habitaciones.hab_numero...
asked by 01.03.2018 / 23:52
1
answer

Problem with foreign keys in hosting with php

Hi, I would like you to help me, someone knows why: create a database with powerdesigner for Mysql. When I upload it locally, phpmyadmin with xammp works, all the foreign keys are created. But when I upload it to phpmyadmin of a hostgat...
asked by 07.03.2018 / 19:11
1
answer

Replace into MySql problem with foreign key

I'm doing an insert in mysql and searching the internet I found the replace into that if the record exists it deletes it and enters the new one, now try it in mysql and it gave me a foreign key error since the registry is associated to another t...
asked by 21.10.2018 / 20:33
1
answer

Can it be verified in DB if it is equal to a string?

I am trying to verify in a field of a mysqli table if it is = an exact string. That is: $consulta = "SELECT count(*) as total FROM productos WHERE productos.stock = 'si' "; Is it well formulated?     
asked by 22.01.2018 / 17:14
2
answers

My database was not utf-8, how to fix the tildes, once already inserted PHP [duplicated]

Good morning. I have a database of 120 records, it is small, but it has an error when there are tildes, for example José a Josà ©, since it is something of practice there is no problem but if it were something bigger, it would have solution, a...
asked by 25.01.2018 / 22:01
2
answers

Use Select statement so that multiple columns appear in only one

Using MySQL, I try to select, for example, the name surname 1 and surname 2, everything appears in the same column with the name Full name. I have tried to solve it using the following but when executing it the results are displayed at 0 or n...
asked by 24.01.2018 / 18:19