Questions tagged as 'mysql'

1
answer

Check if the field is null in java and mysql

How do I check if a database field is populated or is null? Do you have a ResultSet method that does this? In case it is a date field. PreparedStatement ps = connection.prepareStatement("SELECT * FROM tarefas"); ResultSet result = p...
asked by 22.09.2017 / 00:40
2
answers

Remove line break after each INSERT

I have a textarea in my code, where the user will enter access vouchers separated by ENTER. My PHP code treats the typed values as follows: $voucher = explode("\n",$voucher); foreach ($voucher as &$varray) { $...
asked by 19.09.2017 / 15:16
2
answers

I'm having trouble trying to list data from a mysql table

Manufacturing Class import java.sql.Connection; import java.sql.DriverManager; public class Fabrica { public Connection getConexao() { Connection conn = null; try { Class.forName("com.mysql.jdbc.Driver");...
asked by 19.09.2017 / 22:45
2
answers

When to use address table in the database

I'm developing a system where multiple entities will have address. Example: the school has an address, the student has an address, the teacher has an address, the providers have an address, etc. I am trying to use a table to store every addre...
asked by 07.10.2014 / 17:47
2
answers

list of a questionnaire in php

I have a questionnaire and I need to pass a list with the question and the value of the answer, I created a question table and an answer table in my database, but I am not able to pass the value of the answer in this list. > 1. database ta...
asked by 08.07.2014 / 17:03
2
answers

Bring sql record even not having the necessary accent [duplicate]

I need to bring a record called Vidraçaria into a search, how can I bring this record by just writing Vidracaria in the search?    Or bring water by looking only agua The search works normal when the word is spelled co...
asked by 26.11.2018 / 20:37
2
answers

Doubt when performing SQL with Eloquent of Laravel

I have a bug that I do not know the reason for it. I have in my controller the following Eloquent : $balances = BankUser::select(DB::raw('SUM(balance) AS total, created_at, DATE(created_at) AS total_at'))...
asked by 12.12.2018 / 16:46
1
answer

Query data in two tables and add one of the columns

I have two tables I need to do a SELECT in both at the same time, basically it will work like this: Note that the result returns the column nome of Tabela A and sum of column media where ids are equal. Also,...
asked by 01.07.2016 / 13:17
2
answers

Database Search with select value

How do I perform a search in the database, through a parameter reported by the tag select ? Follow the code below: <select class="form-control" id="inputUnidade"> <option>Selecione</option> <option&g...
asked by 28.01.2016 / 12:34
1
answer

How to put quotes in a variable for MySQL query

I'm doing a procedure, I need to put a varchar variable in the query, but it does not go with the single quotation marks, I've tried concatenating it or something like that, but it's no use: set @comando := concat(@comando, '"'); //ao contrári...
asked by 09.10.2018 / 21:33