Questions tagged as 'mysql'

1
answer

What is the difference TEXT and LONGTEXT?

I'm working on a system where I'm going to import data from an Excel. Since these data will be temporary, I want to save the information for this imported column in JSON format in the database. So, I was in doubt about using TEXT or...
asked by 07.02.2017 / 12:06
2
answers

MariaDB ERROR: ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes

When I run this code in MariaDB, it gives me this error when trying to create the toy table:    ERROR 1709 (HY000): Index column size too large. The maximum column   size is 767 bytes. I do not know how to fix, MariaDB has already install...
asked by 30.12.2016 / 14:14
3
answers

"Smart" columns in MySQL

Is there a way I can assign something to a column in MySQL so that when I perform the query I select them? SELECT filtro_1,filtro_2,filtro_3 FROM filtros But if the table is changed (like adding a new filter, now the filtro_4...
asked by 23.05.2015 / 06:46
3
answers

Multiple connections with the Bank

In a PHP system that communicates with BD (MySQL) to retrieve the information and return it to the user who accesses it, is it necessary to establish multiple connections with the Bank? Or just one?     
asked by 20.12.2014 / 19:04
1
answer

What size of a large considerable query?

What size of a large query ? I need to make a function to send query to the server but I can not exceed the limit to not crash the server: public function sqlExecute($sql_code) { if ($sql_code != "" && strlen($sql_code) &...
asked by 05.04.2015 / 01:37
2
answers

how do I return two times using the COUNT (*) function

SELECT COUNT(*) AS contador, hora_efetivada FROM minha_tabela WHERE status=2 I have a counter that returns the total value of status 2 in the database, but in my column named hora_efetivada there are several times. How do I make...
asked by 26.11.2015 / 19:43
2
answers

How to limit log display to 30 days from today's date

I'd like to be able to limit the display of news that I've written to my banco de dados to 30 days from today's date, for example: Show registered news from 03/02/2016 to 02/01/2016 , I tried to use some solutions that I f...
asked by 03.02.2016 / 13:00
2
answers

Dependencies on the same table

A funeral home asked me to do a simple customer registration scheme for them. A customer can have several dependents who benefit from his or her contracted plan if he or she is killed. I am in doubt as to the data model. I could create two ta...
asked by 13.06.2014 / 15:02
2
answers

What is the best way to upload files with Ajax?

I could get a code on the internet paste here and try an answer but I'd rather have it help me with the logic and programming of a script to upload images in Ajax. I do not know how to start, I'm a beginner but I already know some things about j...
asked by 05.08.2014 / 15:23
3
answers

Best way to keep data that depends on a condition

I hypothetically have a publicação table that has, by default, the autores attributes (derived from a relationship table), titulo , edição , editora and ano . However, depending on the type of publication (...
asked by 11.07.2015 / 17:38