Questions tagged as 'mysql'

2
answers

Login panel does not return the number of accounts

I'm creating a login area, but when I click the login button, it does not return any errors, for example: if the user does not exist I would like the number 0 to appear as the $num variable, however a screen page. PHP :      $co...
asked by 12.12.2018 / 23:41
2
answers

Adding values from a column in the database using date filter

I need to sum all the values of a column containing in each row a specific date, that is, in the database, the values are saved with the date entered in textBox in the act of the cadastre, and I must add all the values column quantidad...
asked by 28.12.2018 / 13:00
3
answers

Convert seconds in days

I have a very simple question: How to convert seconds into days? tried using: <?php echo date('d', $userstats['OnlineTime']); ?> but goes only up to 31 days. <?php $userstats_a = mysql_query("SELECT * FROM user_stats INNER JOI...
asked by 11.11.2017 / 20:39
2
answers

Select records smaller than the current date and time

What is the best way to query the database where the data is smaller than the current date and time SELECT * FROM agenda WHERE agendamento < '".date('Y-m-d H:m:s')."'     
asked by 03.08.2017 / 16:07
1
answer

change the output type to currency

I have a code that gives me two columns, Expense and Total, what I can not do is that in the output of the totals it gives me in currency format ($ 1,000.00). the code is this: SELECT nome_evento AS Despesa, SUM(saida_caixa) AS total FROM...
asked by 23.08.2016 / 06:49
1
answer

Problem with connection to DB with codeigniter (mysqli) [duplicate]

Well, I've done a registration form for newsletter. And while loading the database in autoload['libraries'] , it displays an error    Call to undefined function mysqli_init () in /home/softlove/public_html/system/database/drivers/mysq...
asked by 07.07.2016 / 13:15
1
answer

Doubt in the method of using Distinct and Count together!

I have a table requests as the example below: Id | Cliente | Status 1 | XPTO | Proposta 2 | ABCD | Proposta 3 | XPTO | Venceu 4 | XPTO | Perdeu And I want to present a result like this: Cliente | Status | Qtd XPTO...
asked by 04.08.2016 / 19:24
1
answer

Group Duplicate Records in a Single Line

I'm having a problem with a query, in which I need to transform rows into columns. In the case I thought about using the pivot function, but it did not work very well, since mysql does not give me such a function. But the tables are as follows...
asked by 01.11.2016 / 00:56
2
answers

Paste mysql field dynamically

I created a select command based on information sent by the user, eg: $anoini = $_GET['anoini']; //variavel com ano escolhido pelo usuário $anofim = 2016; //ano final é 2016 $s = 'SELECT pa_proc_id, procedimento, '; //inicio da query while ($...
asked by 04.11.2016 / 19:39
1
answer

Which correct way to add two fields

Good evening friends, what is the correct way to add these two value-dependent and adesao fields and display the total value in the input. Adesao = 3.500.33; Dependents = 90.33; Total Correct: 3.590,66 Code <?php...
asked by 09.01.2017 / 23:53