Questions tagged as 'mysql'

1
answer

Using sql_cache in MySQL query

When I learned MySQL, I was advised to use the expression sql_cache after SELECT , something like this: "SELECT sql_cache * FROM tabela..." Since then I started to use this in my codes, but it was never very clear to me what th...
asked by 25.10.2017 / 20:54
1
answer

SQL: MAX (date) with wrong results

Good malt, I have a problem, when searching for the highest date grouping by id, I get wrong value in the obs field. Query in use: SELECT a.n_func,a.id_sk, a.data, a.obs, b.maxdata, b.obs FROM chklist a INNER JOIN ( SELECT n_func, id_sk...
asked by 07.12.2016 / 16:26
1
answer

How to Call Other Class Values

I am creating a vehicle control, and in it I have a Fuel register that has description and value, and another cadastre of Supplies. In my supply register has a autoComplete of Fuel. The problem starts here, when I select the fuel I need t...
asked by 16.11.2016 / 13:39
2
answers

php query filter mysql

BD Structure Companies ----------------------------------- | uid | nome | endereco | | 1 | empresa01 | endereço01 | | 2 | empresa02 | endereço02 | ----------------------------------- Products -----------------...
asked by 15.11.2016 / 14:39
2
answers

How to switch table colors by grouping by a specific table field?

I have the following code. <table style="width:100%;"> <thead> <tr> <th scope='col'>&nbsp;&nbsp;Nº Comanda&nbsp;&nbsp;</th> <th scope='col'>&nbsp;&nbsp;Produ...
asked by 04.10.2017 / 13:35
1
answer

MyISAM is the default storage engine on this MySQL server? [closed]

I saw this message today:    MyIsam is the storage engine by default in this MySQL server As so " by default "? What fault is that? I use InnoDB, and even then this message appears. Is there any problem in leaving like this? So far...
asked by 16.10.2017 / 22:00
1
answer

Delete select value comparing to another table

Good morning, I'm developing a scheduling website, however, I'm having a hard time trying to display only the times that are available. Explaining: There is a schedule Agendamento´, onde fica registrado o horário de inicio horainicia...
asked by 19.11.2016 / 14:45
2
answers

SQLSTATE [23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

When I try to INSERT my table with PDO, I get the following error: SQLSTATE [23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' I've done a lot of research and saw some similar problems, but all for lack of AUT...
asked by 21.11.2016 / 17:00
1
answer

Interval in minutes of a period

I'm trying to make a select that lists in a range of 10 minutes a value of the bank, is there any way to show the data even though it does not have data in the range correctly? Example :    00:00:00 = 0      ...
asked by 21.11.2016 / 14:45
1
answer

Multi connections MySQL Codeigniter

In my database.php I created two connections: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['usernam...
asked by 04.10.2016 / 17:38