Questions tagged as 'mysql'

1
answer

How to clear the MySQL queries cache?

How do I clear the queries cache stored by MySQL? What is the command?     
asked by 24.02.2016 / 12:48
2
answers

Update multiple records together with select

I need to do UPDATE with SELECT for multiple records, today I'm with this query: UPDATE banco.ordem SET valor = (SELECT (CEILING((litros * 3.67)*100)/100) AS valor_litros FROM banco.ordem WHERE ordens = 2763) WHERE ordens = 2763 Thi...
asked by 19.10.2016 / 15:14
1
answer

Insert in the table if there is no

How to insert data into a table only if it does not exist? the following attempt returns an error, the basic idea is to insert a unique mode record, if it already exists ignore, otherwise insert the record. INSERT INTO registro_tb (nome, tag)...
asked by 17.10.2016 / 07:05
2
answers

Column difference and sum DATETIME [closed]

I have a table named chamado_processos with the following structure and data As you can see one of the columns in this table called dt_processo is a DATETIME field and the tp_processo column defines whether the...
asked by 10.10.2016 / 14:35
2
answers

Resizing image when inserting with php

I want to insert the image into the site by type="file" it resizes to 400x300, I tried everything but I can not. Image verification code to send to BD and insert into website: require_once("conn.php"); $imgm=$_FILES['imageM']; $imgf=$_FILES...
asked by 08.11.2016 / 18:38
1
answer

Count equal dates select MySql

Hello, in a MySql database I have a table like this: email | data_envio a |2016-10-01 05:32:57 b |2016-10-02 09:36:56 c |2016-10-02 08:16:52 d |2016-10-03 10:36:51 e |2016-10-04 10:36:51 How do I make a sel...
asked by 17.11.2016 / 17:22
1
answer

DEFAULT CURRENT_TIMESTAMP [duplicate]

Using DEFAULT CURRENT_TIMESTAMP when done UPDATE this date will also be updated to date UPDATE ? Or is it fixed and inserted only once at the time of INSERT ?     
asked by 30.10.2015 / 20:26
2
answers

What is the difference of bindValue for an array executed directly in $ pdo-execute ()

I currently use a schedule like this <?php $array = array('nome'=>'Alisson', 'idade'=>20); $query = $conn->prepare("INSERT INTO table (nome,idade) VALUES (:nome, :idade)"); $query->execute($array); ?> What's the differe...
asked by 18.12.2015 / 02:52
1
answer

Index limit with LIMIT

I've never been an expert in sql but I will always come, nothing that a googlate has not solved. But I have a question that I did not find information about. Recently I did some tests to find out why an sql was slow and I came across the foll...
asked by 11.12.2015 / 17:43
1
answer

Error connecting database with PDO

I have an OOP code in PHP, when I try to connect to the DB, the following error appears:    Notice: Undefined variable: operator in C: \ xampp \ htdocs \ StudentCount \ app.ado \ TCriteria.class.php on line 16       Notice: Undefined variabl...
asked by 05.09.2015 / 18:16