Questions tagged as 'mysql'

1
answer

Select Float Mysql

In mysql field is stored 104.13 in format Float ; With this select, I can see the record: SELECT * FROM parcelas WHERE valor like '104%'; But with this select it does not appear: SELECT * FROM parcelas WHERE valor =...
asked by 18.04.2018 / 15:44
3
answers

OFFSET next to COUNT (*) returns nothing?

When I make an inquiry this way the data is returned correctly (Currently 2 rows): SELECT * FROM noticias ORDER BY data_noticia DESC LIMIT 30 OFFSET 2 But I need to know how many rows this query returns me so intuitively it would look like...
asked by 06.09.2018 / 23:28
2
answers

Format the return of the MySQL Now () function

So folks. I need to know if I'm going to just send the hours H: i: s from the NOW() function in the database, or send the NOW() complete and then only search the hours?     
asked by 13.07.2015 / 19:28
1
answer

Save full path in the bank or just the name with the extension?

On the systems I used to develop before, I used to save the full path of the file in the database. Example: c:\xampp\htdocs\teste\imagens\post_44\stack_overflow.png // Image table imagem - id = 1 - imagem = imagens/post_44/s...
asked by 04.02.2015 / 13:03
2
answers

Convert a positive decimal number, negative

I have the following query : Valor1 = '200.000,00'; select Valor1 from TB1 Is there a function that converts a positive number to negative?     
asked by 18.12.2015 / 10:56
1
answer

Send email with Accents BD Uft8

I have a problem sending email with names that come from the database. Some names come with accents and when I get the emails the names are unconfigured. The database is like Utf8 - Default collation Code php: $PHPMailer->Charset = 'U...
asked by 25.06.2014 / 10:58
3
answers

Date in the format dd / mm / yyyy?

I created a table, where I put the user's registration on a card for printing; so this table has several records (5 per page) and for each page I access a record in the same table I made an array_push with values -> $sql = mysql_query("SELECT...
asked by 19.08.2014 / 23:51
2
answers

Do not register in the time zone if it already exists

How do not register events in the time zone that is already registered? Example: I have an event in the DB beginning at 18:00 and ending at 22:00, I need that if the user tries to register a new event from 19:00 to 23:00 the system do not a...
asked by 24.08.2014 / 00:23
2
answers

Use AND within an INNER JOIN can?

I wonder if it is possible to use AND within a INNER JOIN , eg: SELECT * FROM tab1 INNER JOIN tab2 ON tab2.id2 = tab1.id1 AND tab2.camp1 = 'valor' INNER JOIN tab3 ON tab3.id3 = tab2.id2; I gave a rather silly exa...
asked by 10.02.2017 / 14:35
2
answers

Length of field occupies total value defined?

If the maximum length of a field of type VARCHAR is 65535 (ocupa 65KB) , will it always occupy a space of 65KB in the database for each line even if I put less text in it? EXAMPLE: Does a VARCHAR(65000) field occupy 65kb e...
asked by 26.05.2017 / 19:14