Questions tagged as 'mysql'

2
answers

Total Sub-Records - MySql

In my bank I have several tables, but I'll make a simple example of what I want to do: Assuming two tables: Table 1    id | shop | date Table 2    id_2 | id_tab1_2 | product Note that id_tab1_2 is a foreign key, link...
asked by 24.07.2018 / 04:19
2
answers

While ResultSet.next () returning only one result

I have a problem, when I put the ResultSet.next() in while and I get the information in the Database column it returns only one result. People table: Pessoas: Idade: Marcos 22 Marcos 24 Marcos 25 Robe...
asked by 20.07.2018 / 21:12
2
answers

Increase +1 in the database

Well, I wanted to count +1 in mysql, and I'm not getting it. Code below <?php $con=mysqli_connect("localhost","root","asdasd","dbb"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $...
asked by 20.07.2018 / 02:07
3
answers

MySQL printing multiple times

I'm having a problem printing the MySQL data in Eclipse. When I put to print the list of the registered data it is printing 3 times each information. I know where the problem is, but I can not see the solution. My database has a schema and...
asked by 24.07.2018 / 03:06
1
answer

Pick up the records for the current week

I have a system where the user registers the information in a Mysql database. One of the fields is DataCadastro of type Date () and it is only registered from Monday to Friday, that is, on the days that the company of that user works. I just...
asked by 24.07.2018 / 15:54
1
answer

query using Case when

Can anyone help me with this query, please? I'm having a hard time organizing this 'Case when' I think CREDITO | CONTA | TIPO 100 8 ENTRADA 30 9 ENTRADA 30 10 ENTRADA 1 8 SAIDA 10 11 EN...
asked by 14.05.2018 / 17:13
2
answers

Mysql Help to Return the Unavailable Days to Schedule Time

I have 2 mysql tables that represent the unavailable days for scheduling: holidays table: id, day (date), name Special_days table : id, day (date), will_work (boolean) At the end I need to select the unavailable days which are the hol...
asked by 15.05.2018 / 14:15
1
answer

(MySql) Insert or Update in the database

I need to perform a Insert in the database if there is no person's cpf. if it exists it has to do a Update . But all this through a single script in MySql . I have illustrated the example below as I am doing today: 1 If the cpf of the...
asked by 16.05.2018 / 03:39
2
answers

Insert file system image name in mysql

I use Debian, and I need to capture the name of the images in a folder and insert the names (as string) into a mysql table. ss:~/folder_img$ 859034809583_img.jpg 458389547389_img.jpg ... This problem has now come up and I have no idea how t...
asked by 04.07.2018 / 06:36
1
answer

Mysql Left outer join show only the first result

I need to make this join of the sales table with the Nfe table, but the NFE table can have more than one result which causes a change in total sales, how can I change this join to get only the last note? p> select sum(total_venda) as total_ven...
asked by 03.07.2018 / 14:43