Questions tagged as 'mysql'

1
answer

DOMPDF only rescues the html and not the data I get from the database

I need to extract to PDF the content HTML of a page inf_ev_003_7.php The problem is that I only extract the HTML and not the data I get through SQL and PHP in this inf_ev_003_7.php **así...
asked by 10.12.2018 / 02:57
1
answer

if and elseif in Laravel

I am taking data from a BD and depending on the number that I return, it has to show one class or another. I'm doing something like that but it does not work. @if ($vivienda->etiqueta == 1) <p class="pLab">¡ {{ $vivienda->etiquet...
asked by 10.12.2018 / 21:13
1
answer

How to insert quotes to the key in a query with "JSON_OBJECT"? from mysql

I use this query: JSON_ARRAYAGG(JSON_OBJECT("id",pd.id_pedido_detalle,"cantidad",pd.cantidad,"precio",pd.precio_pedido)) This gives me the following result: [{id: 991, cantidad: 1, precio: 10}, {id: 992, cantidad: 1, precio: 20}] I try...
asked by 26.12.2018 / 19:51
1
answer

show summation of mysql columns and their columns

I've been googling and I do not quite understand how to show the sum of a column and show the values of the columns I add. for example: Table Users id, first name, value1 value2 I would like to show the sum of the values 1 but I would l...
asked by 27.12.2018 / 10:39
1
answer

Problem when using the Foreign key and references

Hello, how I have a problem using the FOREIGN KEY and REFERENCES with MySQL Workbench according to the dubugger is a syntax error CREATE TABLE IF NOT EXISTS pedidos( id_pedido INT NOT NULL auto_increment, fecha_pedido DATE, cantidad_p...
asked by 26.12.2018 / 22:54
2
answers

recursive MySQL query

Good afternoon colleagues, I hope you can help me with this query that drives me crazy. You will see I have a table with data like these And I need an SQL query I order the data in this way Vertebrates Mono Cat Dog Horse M...
asked by 18.04.2017 / 04:09
1
answer

Parameterized query php output

Modifying my school codes to add parameters, because I do not understand the php documentation and I do not know how to get the result of the query. From the privilege table should give 1 (administrator) or 2 (secretary). Help please. try {...
asked by 27.11.2018 / 03:45
1
answer

Using Docker and Laravel I have this error with MySQL: "SQLSTATE [HY000] [2002] No such file or directory"

I have an app in laravel 5.2 that connects to my mysql local database, without problems. But, when placing the app inside a docker container, it can not connect to the database and I get this error: SQLSTATE[HY000] [2002] No such file or dir...
asked by 29.11.2018 / 20:10
2
answers

Bring everything from MySql with PHP and show in JSON

I have a problem with PHP and JSON. What I do is try to bring all the data from the database, but it only shows me the first one. If I put a WHERE it brings me the right one but I want everyone and it only brings me the first one. I do not under...
asked by 22.11.2018 / 16:43
1
answer

Help with If statement during data entry in MySQL in PHP

I need help with the following sentence $sql = "INSERT INTO tarjetas (id, monto, codigo, serial, usuario, id_pedido) VALUES(null, '$monto', ' $codigo', '$serial', '$user', '$id_pedido')"; $resultado_ingreso = mysqli_query($db, $sql)...
asked by 06.11.2018 / 16:43