Questions tagged as 'mysql'

1
answer

Control access to documents [duplicate]

I'm creating an application to manage files, the files are being saved in a local directory "localhost / uploads ...", I have a "documents" table with a "file-url" field, where I save the file path, too I have my user table, now I need to defi...
asked by 08.10.2017 / 16:27
1
answer

Problems to count and group fields in the database

I'm starting to study the SQL language and the interaction between tables, and I came across an exercise in a list that I can not solve. It asks for the following:    For each existing product, tell what sales were made and   how man...
asked by 20.09.2017 / 19:15
0
answers

Comparison with 3 tables

create table Pessoa ( id int not null primary key auto_increment, nome varchar(150) not null, cidade varchar(100) not null, cpf char(14) not null unique, rg int not null unique, INDEX idx_nome(nome) ); create table conta(...
asked by 20.09.2017 / 16:18
1
answer

Error updating given with condition

I am trying to run this update but it only updates the "value" column if the "discount" column is different from 0.00. If it is 0.00 it enters the second condition of the IF and places the value of itself in value. If it is different it does the...
asked by 17.09.2017 / 06:21
1
answer

Create Mysql database at run time

I'm developing a Java application and I need this application to run check that the database exists, if it does not exist, it creates the base and its tables so that the application can enter the data. Can anyone help me?     
asked by 17.09.2017 / 03:47
1
answer

How to generate two Google Charts on the same page?

I know the code below generates 1 graph within the page however I need to generate several graphs and I do not know the logic used to dynamically achieve the goal. Can you help me please? <script type="text/javascript" src="https://ww...
asked by 18.09.2017 / 02:15
0
answers

Idea for cleaning and data-processing library

I need to make a library for data processing, so I can use it before calling functions such as: Register, Change, Delete and etc ... I am using PDO for communication with the mysql database, and the method itself already has some security mea...
asked by 17.09.2017 / 13:50
0
answers

Mysql query with grouping by day and time range

Good afternoon. I am putting together a page with reports based on the amount of sales a bar made. There is only one problem. I need to generate a sales report per day until I got it done by grouping "SELECT count(id) total, DATE(data_aber...
asked by 19.09.2017 / 21:10
0
answers

Problem with mysql function mysqli_insert_id ()

I have the following query: $ad="INSERT INTO comanda_aberta set numero='$a', data_abertura=NOW(), data_fechamento=NULL"; mysqli_query($con,$ad); $idcomandalast = mysqli_insert_id($con); When I give a print in the variable $idcoman...
asked by 22.09.2017 / 03:00
1
answer

SQL syntax error SUM ()

I have the following scenario: A table of products ( tbl_prods ) that has, among other fields, the price of each product, the type of products and the date of the transaction (% with%). The types can be dt_trns , typ1 or...
asked by 06.10.2017 / 20:36