Questions tagged as 'mysql'

1
answer

How to return the sequence of the week in the reported period?

Good morning, I need to return the sequence of the week of the month (of the reported period) in two fields, start date and end date. In PHP and MySQL . Currently returns the number of the week in the year, follow print for a better...
asked by 17.05.2018 / 14:59
2
answers

How to connect to the Mysql of Xampp from another server with linux installed?

Hello, I have a test server known as Xampp in it, I have an active database in mysql, but I also have another server with apache running on another machine, and it is on this machine that I want to run the codes in php, on the local machine it wo...
asked by 22.02.2017 / 02:23
1
answer

MySQL - List results from 2 tables

I have two tables with the same field and I need to make a SELECT with two conditions, I am trying this code but it is listing only the result of the first table ( entrada ), not the second table ( saida ): SELECT * FROM en...
asked by 09.02.2017 / 02:19
1
answer

Difference between normal avg and using case when in MySQL

I have two queries that are supposed to give the same result, however it is not happening. Can someone explain to me why it does not show the same result? Query that returns the expected result: SELECT id, ROUND(AVG(SinalGPS), 4...
asked by 10.02.2017 / 18:29
1
answer

Should I use prepare in Procedures

Below I have a code snippet adapted to exemplify this question: <?php $params = [ ':codUser' => $_SESSION['data-user']['codigo'], ':codCarrinho' => $codCarrinho, ':codPremio' => $codPremio, ':quantidade' =&g...
asked by 10.02.2017 / 18:27
2
answers

Delete record that is being duplicated in the query with the inner join

I am doing a query to my database and in this query I use an INNER JOIN to join two tables! But I have a problem, because I do not know how to handle the JOIN very well, and this is causing a small problem. In my current database I am join...
asked by 10.02.2017 / 07:07
1
answer

MYSQL - Query adding 8 identical tables

Good afternoon, I'm pretty new to MYSQL, basically I'm learning about searching the net, but there was an issue that I could not solve. I have about 6 tables, in each I have 10 fixed and identical entries in the field ID and TYPE, which do no...
asked by 10.02.2017 / 19:55
1
answer

How to create product relationship with php and MySQL

Some time ago I made a product relationship attempt, but it was not functional and I think it was not the right way, I confess, the same is bad, what I did was basically this: I look for the lines (Categories) and just below where the checks...
asked by 17.03.2017 / 19:19
1
answer

How to compare the structure of two tables and update the other?

The question is the same as the title: How to compare the structure of two tables and update the other? I have an online database, which I want to update the structure of the database. I also have some customers who use banks tapped offlin...
asked by 17.03.2017 / 00:04
1
answer

How to change table records in the Database after 30 days?

How do I create a condition in PHP that changes the record of a field in a column in the database every 30 days? Example: if ( $valor == 'value_1'){ // Função que altera o registro } value_2 // Value for which to change m...
asked by 01.02.2017 / 19:50