Questions tagged as 'mysql'

1
answer

How to create rule in MYSQL to divide the value of one column by another?

I want to know the average values (value2) in a table using AVG () (or another form). I have a table in MYSQL with the columns id, total_value, valuem2 (Value per m²), and area. In some lines the value m2 is empty and in others the total v...
asked by 07.08.2018 / 19:59
1
answer

Missing IF in procedure

I did the following procedure, but in END// 'missing if' appears, does anyone know why? William helped me with this problem, but whenever I try to register, the procedure only goes to the last else . I called it this wa...
asked by 06.07.2018 / 20:11
2
answers

Get last grouped MySql record per year

I have the following table I need to return only the last record of the teaching step sorted by year_level, using Laravel / MySql Example: 2002 - 15 / 2004 - 16 I'm trying: $carga_horaria = DB::select(DB::raw('ch.*')) ->f...
asked by 17.08.2018 / 16:03
2
answers

Search by date in MySQL does not work

I have a query in my PHP code that was working normal, but it suddenly stopped working without me making any kind of change. SELECT * FROM comportamento_loja where ativado = 1 and datahoje BETWEEN DATE_FORMAT(STR_TO_DATE(data_inicial, '%Y-%m...
asked by 06.07.2018 / 03:35
1
answer

Why is my connection to the database not working? PHP object-oriented

<?php <?php class getForm{ public $nome; public $email; public $tel; public $query; public $conexao = null; public $usuario = "root"; public $senha = ""; public $banco = "testando"; public $servidor...
asked by 16.07.2018 / 04:10
1
answer

Count mysql records in Y format to display in wizard-style form [duplicate]

Hello, I have a problem with counting the records of a table in the database and show it as in this example: 1 (X) of 10 (Y) when clicking "next" of the form would be 2 (X) of 10 (Y) and so on, as you progress the form increases +1 by X. To...
asked by 15.08.2018 / 08:26
1
answer

Insert users into different database

I have two Database. Database A, and Database B. The user makes his registration in the data bank system A. I want to create a trigger for the same time, this register also go to database B, so that it has access to the other system, with the sa...
asked by 28.06.2018 / 22:29
1
answer

Search for NULL mysql via Java

I want to write a resident in my database via java when one of the searched parameters is NULL , but it turns out I can not figure out how to pass this command. My code is: public Usuario registraSaida(String nome) throws SQLException...
asked by 05.06.2018 / 05:48
1
answer

Retrieve name of mysql tables

I would like to retrieve the name of my tables in java with mysql database. I do not know if it is correct I get a hashcode: (1) model.Campanhas@b5cca49 (2) model.Campanhas@5c369e04 public ArrayList<Object> nameTables(){ try {...
asked by 10.06.2018 / 03:22
1
answer

Fatal error: Call to undefined method mysqli_stmt :: bindparam () PHP || MYSQL

I've had this error for a few days, I've seen similar answers here on the site and also in the English community, but I do not find the right answer to my situation.    Fatal error: Call to undefined method mysqli_stmt :: bindparam () in C: \...
asked by 04.06.2018 / 15:41