Questions tagged as 'mysql'

1
answer

How to update several records in Mysql from PHP?

My question is how can I update several records of a Mysql table from php? In the variable $ conver2 the values that I want to insert are saved I put the update inside the foreach so that the sentence would be repeated according to the amo...
asked by 07.05.2018 / 20:26
1
answer

SQL duplicate management

It turns out that I have to make a query in which I get returned several duplicate records, except for a field that is counters. The question in itself is that I need to collect the record with the highest value of counters. Right now the sen...
asked by 07.05.2018 / 10:47
3
answers

Validate JPG or PNG PHP image

Well the point is that I do not know how to validate the following, in the database I capture the url of an image and then I show it with a echo in php, what I try to do is validate the image either jpg or png to then export it in an exce...
asked by 07.05.2018 / 05:09
1
answer

The NULL field does not return

Good day, I would like you to help me with this problem, this is my query: SELECT Nombre, Cedula, sum(HorasTrabajo) as HorasTrabajo FROM reportebeteitiva group by Cedula WITH ROLLUP; Result in: _____...
asked by 28.05.2018 / 15:31
1
answer

MYSQL select recursive between 2 tables?

I have two tables (exam) and (note) that are related to each other by the column "id" of the table (exam) and the column "id_examen" of the table (note). I want to get the average of the grades for each exam. For example, the exam with id...
asked by 03.06.2018 / 07:49
2
answers

Error consulting text with emojis in mysql

Update ... I have the following table: CREATE TABLE 'chrislat_cms'.'opciones' ( 'id' INT(11) NOT NULL AUTO_INCREMENT , 'nombreOpcion' VARCHAR(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , 'valorOpcion' LONGTEXT CHARACTER SE...
asked by 29.05.2018 / 04:22
2
answers

Trying to get property of non-object in line 18

In the line that there is error is in this: if ($resultado->num_rows() > 0) ... This is my code: <?php $mysqli= new mysqli('localhost','id5840508_root','******','id5840508_hospital '); $salida=""; $query="SELECT*FRO...
asked by 20.05.2018 / 19:30
1
answer

dates timestamp problems when converting

I have stored the "dates" (it is a varchar) and I need to take it to another format to do operations, and many poor options and the one that seemed to help me dateformat arrogates values to me in zeros, I also have to keep the hours and minutes...
asked by 19.04.2018 / 16:35
2
answers

MYSQL does not allow entering the engine

I have mysql installed on ubuntu but when I want to enter the databases with the command: sudo mysql -u root -p It does not allow me to enter, the following error appears: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (usi...
asked by 04.06.2018 / 22:06
2
answers

I DO NOT GET ANY MYSQL REGISTER IN PHP

I've been working with php for some time and trying to make the MYSQL code work inside PHP, I'm working with PDO but at the moment I want to get the records from my database and put the print_r ($ variable); shows me an empty array. <?php...
asked by 09.08.2018 / 18:07