Questions tagged as 'mysql'

1
answer

Help with query creation task schedule

Galera, I am making a script to trigger a message according to the record recorded in the database. It's like a CRON task. I have the following record I'm going to put a PHP page in the CRON task of Cpanel, but how can I make a query...
asked by 22.06.2017 / 14:55
0
answers

Improve MySQL COUNT performance

I have a web application that performs several queries, however a count query is taking 2 seconds to fetch and return the data to the application. My table in which I do COUNT has 230,000 lines with about 20 columns, how can I optimize this quer...
asked by 19.06.2017 / 01:07
1
answer

Simplify subtraction between MySQL tables

I wanted to know how to simplify the following excerpt: SELECT FORMAT((SUM(r.valor_receita) - (SELECT SUM(d.valor_despesa) FROM despesas AS d WHERE d.pago = 1 AND YEAR(r.data_vencimento) <= YEAR(d.data_vencimento) AND MONTH(r.data_venciment...
asked by 19.06.2017 / 02:46
1
answer

I need a help with Database

I have this table in my database IneedtobeundertheCreated,Ihave1optioncalledPayment(insidedestáwithtwooptions,PAY(IWANTJACOMESWITHTHATPATTERN)andafterthatIcanchangeto(PAY).?     
asked by 15.06.2017 / 21:51
1
answer

Confirm registration by sending email

Hello! I have a registration and emailing code, but I do not know why, it is not working ... resgistar.php (registration form) <!-- Form do Registo --> <div class="w3-row-padding w3-padding-64 w3-container"> <div...
asked by 29.06.2017 / 00:15
0
answers

Query MySql comparing with PHP array

I need to mount a SQL query to search for more than one value. Type: SELECT * FROM tabela WHERE id = 10 OR id = 20 ..... But I found this option: SELECT * FROM tabela WHERE id IN (' . implode(',', array_map('intval', $idgrupos)) . ')...
asked by 27.06.2017 / 14:10
3
answers

How to put default value in time field in mysql?

I searched the web but did not find anything specific to field time in mysql, just date and timestamp, I am creating a field "time_emission" of type "time", because I want to store only the time in this field, the line would be as follows: ADD...
asked by 21.06.2017 / 17:20
2
answers

Problems with update in federated table

I have a problem understanding an error when using a federated table. Scenery:    Server A: create view federated_view as SELECT ....       Server B: create table table_federada (A, B, C)       ENGINE = FEDERATED CONNECTION = 'mysql: //...
asked by 21.06.2017 / 16:13
0
answers

Error: "mysql_num_rows () expects parameter 1 to be resource, null given in Query was empty"

I'm working on a document management system and I'm trying to create reports that show me which documents were inserted daily, but I get the following error:    Warning: mysql_num_rows () expects parameter 1 to be resource, null   given in Qu...
asked by 12.06.2017 / 17:01
1
answer

Row Results in Columns (SOMA)

Good afternoon, I have a big question in my query, I have a table with the following info: Iwouldliketogetthefollowingresult I need the result to be the total amount of (payment forms) per day, divided by period in two columns, M and N....
asked by 12.06.2017 / 19:57