Questions tagged as 'mysql'

2
answers

Syntax PHP error ""

// retrieve selected results from database and display them on page $sql = 'SELECT * FROM publicaciones LIMIT ' . $this_page_first_result . ',' . $results_per_page; $result = mysqli_query($conexion, $sql); while ($row = mysqli_fetch_assoc($resu...
asked by 04.07.2018 / 11:12
1
answer

Error UPDATING Duplicate entry '1' for key 'PRIMARY'

I'm trying to update a record in the database and I get this error: <h1>A Database Error Occurred</h1> <p>Error Number: 1062</p> <p>Duplicate entry '1' for key 'PRIMARY'</p> <p>UPDATE 'compra'...
asked by 28.06.2018 / 15:28
1
answer

Optimize a MySQL query that puts the server at 100% CPU

I have a query that makes the MariaDB server occupy 100% CPU for more than 10 minutes and finally the page gives timeout. The query in question is the following: SELECT formasdepago.nombre as 'Forma de pago', SUM(transaccion) AS Total...
asked by 30.06.2018 / 22:46
1
answer

How to make a purchase matrix in DQL or MYSQL

I would like to create a matrix with two tables in sql in the following way: I have a table that contains the data: id | name 00 | Form 0 01 | Form 1 02 | Form 2 03 | Form 3 04 | Form 4 another table: id | name 00 | person...
asked by 09.07.2018 / 07:52
1
answer

Get form variables when submit and pass them to a php

I would like to know how to get the input values of a form. I show the current values extracted from the database by means of an echo and the intention is to be able to change them. The code (editproyectos.php) would be:      <table class...
asked by 06.07.2018 / 15:21
1
answer

Use of group_concat with eagger loading in Laravel

   I have to return in a table in HTML, the name of the user and the   names of posts; however, I have registered more than one post   user; for which I require to use group_concat() for   put them in a single cell; I'm trying it this way...
asked by 26.08.2018 / 02:38
1
answer

No results are produced with the LIKE command from Android

From Android Studio I make the following query against a MySQL database SELECT id_ave, Date_format(fch_ave, '%d/%m/%Y') AS 'fecha', zon_ave, cli_ave, per_ave, tip_ave, Ifnull(nom_tip_ave, 'Sin tipo')...
asked by 24.08.2018 / 16:19
1
answer

how to insert data in php array, mysqli?

I need to insert multiple records in a mysql table, from another table, but only the first record in the table is inserted my code is as follows if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } echo "Conectado a la ba...
asked by 11.06.2018 / 22:39
1
answer

Put each row obtained in independent columns. MySQL

I make this query: SELECT idFormacion FROM alumnos_formacion And I get this: |idFormacion| ------------- 6 9 12 My question is whether a query can be made to put each row obtained in independent columns. |idFormacio...
asked by 11.06.2018 / 12:49
1
answer

Obtain an id using the count () and max () functions

I do not know what title to put to ask this question so all help to get this question resolved is welcome. Given the following tables: The result I want to get is the depto_no of the department with the most employees, that is:...
asked by 11.06.2018 / 21:18