Questions tagged as 'mysql'

1
answer

Compare 2 tables in the database using PHP

I'm doing a program where I compare in a database (Mysql-Workbench) 2 columns (difficulty, difficulty_student) of 2 different tables (EXERCISES, ANSWERS) in a column difficulty_choice of the table < strong> ANSWERS . I mean th...
asked by 16.08.2018 / 13:03
1
answer

I do not receive values from SELECT FROM but from INSERT INTO and if the record exists (MVC, PDO, MYSQL)

Hi, I'm working with PHP and MySql with PDO and the model view controller (MVC) but I have an error when trying to do a SELECT * on the model side. My intrigue is that it works when I do INSERT INTO and when it's a SELECT. what I do is a validat...
asked by 04.07.2018 / 18:39
1
answer

Give permission to a file when making a queries log (queries) in mysql

I try to make a mysql querys log in ubuntu and do the following (recommended for mysql 5.6+, which is the version I have): [mysqld] general_log = on general_log_file=/var/log/apache2/mysql-query.log in my my.cnf file. When I restart the...
asked by 03.07.2018 / 19:09
0
answers

GROUP_CONCAT within another GROUP_CONCAT

I have a query that gives me a column with the following results: 0,1,1,1,1 1,1 0,1,1,0,1,1 0,1,1 I need if the string contains only a few, return me to, if it has only 0,1,1 or strings of 0,1,1 return me b and otherwise return me c The...
asked by 04.07.2018 / 17:10
1
answer

JDBC Error: "Exception in thread" AWT-EventQueue-0 "java.lang.NullPointerException"

I am trying to create a simple Java program that can register, query and modify data from a database in MySQL. The program itself compiles me well, but when sending the Query, I miss this error: Exception in thread "AWT-EventQueue-0" java.lang.N...
asked by 14.07.2018 / 23:43
1
answer

Can a zero be placed in a query if there is no equality when comparing two fields in mysql?

I have two tables in a database (in Mysql) both tables have different fields, one of which has a field called cuenta and costo , and the other one a field called numero : Tabla uno cuenta | costo Y, Tabla dos num...
asked by 13.07.2018 / 23:23
0
answers

doubt with sql pivot

I have a table of potatoes idpapapa| nombrepapa| 0001 | fernando | 0002 | otro papa| and one of students where with the following info idhijo| id papa | nombre hijo 1 | 0001 | rebeca 2 | 0001 | ruben How ca...
asked by 04.07.2018 / 23:35
1
answer

Problem data Date in method jsf

It may be a silly question but I have not been able to solve the problem I have the following methods: public long contarPedidosMeses(int cedulaCliente, int codigoProducto, Date fechaIni, Date fechaFin){ Query q; q = em.createNativeQu...
asked by 29.05.2016 / 19:43
0
answers

iterate over a connection to mysql and execute a query

I find the following problem .. I generate a connection to mysql through the following package , where I have two tables: 'rto' and 'vta ' And based on that build an INNER JOIN where I show what is required, now I need to execute that query...
asked by 13.06.2018 / 17:06
1
answer

Problems with pdo connection and prepared queries php poo

I get the following error:    Fatal error: Uncaught Error: Call to a member function prepare () on   null in C: \ xampp \ htdocs \ EPWeb \ Admin \ Business \ CapaNegocios.php: 17 Stack   trace: # 0 C: \ xampp \ htdocs \ EPWeb \ Admin \ Presen...
asked by 25.06.2018 / 04:16