Questions tagged as 'mysql'

1
answer

Search for similar items when using a brokerage table?

Following some advice to optimize queries in MySQL, I decided to split a list of items into 3 tables: Table animes: +----------------+-------------+ | id | titulo | +----------------+-------------+ | 1 | Anime...
asked by 17.07.2018 / 02:32
1
answer

DataGridView displaying incomplete id

The grid displays only the first character of the "ID" For example: if the ID is 16 it displays 1; If it is 20 it displays 2; But from 1 to 9 displays correctly ... Codethatselectsdata...privatevoidlixeiraDialog_Load(objectsender,Event...
asked by 30.08.2018 / 22:10
1
answer

Use ON UPDATE CURRENT_TIMESTAMP when changing specific field

Example scenario Table: usuarios Fields: id , nome , sobrenome , senha , timestamp_alteracao Question The timestamp_alteração field should only be updated when the senha field chan...
asked by 28.11.2018 / 12:29
1
answer

How to leave the date with Brazilian standard in Codeigniter 3?

I'm developing an application that takes the registration date of the registry. But is getting the date with American standard YYYY / mm / dd how do I correct this in codeigniter? Here is an example of my code. minha página html <d...
asked by 05.12.2018 / 20:33
1
answer

Notice: Undefined offset looking inside array with for

Hello My code is a calendar and it works as follows, there is an array with some times inside: $horarios = ["08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00"]; I then do a SELECT on the database loo...
asked by 15.05.2018 / 16:09
2
answers

PHP - Latest Selection Question

Good, I created a cryp that shows all messages from the user limited to 3. My goal is for messages to show like this every time they're recent. MSG hora: 12:30 - OLA MSG hora: 12:31 - OLA MSG hora: 12:32 - OLA The problem...
asked by 28.05.2018 / 01:38
3
answers

count the same database text in php

Good morning, my question is this: in my case I have a table in the database that allows to evaluate a service, the classification is made by colors "red, yellow and green", ie the type is text . What I wanted to do is query in...
asked by 07.06.2018 / 10:22
1
answer

Limit the number of results of a sub-query with UNION in real time for performance improvement

I need to fetch many values that require two queries with different conditions. To do this I use a UNION , but I need to set a limit of results. Today this is working with a limit and offset as shown at the end of the exam...
asked by 11.05.2018 / 22:04
2
answers

SQL Query to select student and student name

I have this simple relational model, and I need a query that selects the student and the student's name.     
asked by 13.05.2018 / 00:34
1
answer

How to get total sales per month with mysql

I have a sales chart that records the date and time of the sale. The output format is this: "2018-09-02 15:00:08" I wanted to get total sales per month but I'm having a hard time putting the query together. How can I filter only the mont...
asked by 06.11.2018 / 19:32