Questions tagged as 'mysql'

1
answer

CascadeType.ALL does not work. Am I using it wrong?

In my code, I have the Author and Book classes with the Many To One relationship, as below: Author.java import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.F...
asked by 20.12.2016 / 14:03
4
answers

How to save line breaks from a textarea to the database? [duplicate]

I have textarea and would like to save the line breaks made by the user in the database. For example , the user writes the following: "Lorem Ipsum. Is simply. Dummy text. Of the printing. And typesetting." But in the database, i...
asked by 06.01.2017 / 20:08
3
answers

How to index and update a user comparison system?

I have 2 tables with characteristics and interests of users in a MySQL database with innoDB    Feature Table id nome sobrenome cidade estadocivil altura peso fisico pele olhos filhos querofilhos bebo fumo denominacao frequencia importancia...
asked by 06.03.2014 / 19:17
2
answers

Get an inverse relationship with Laravel

I am creating a forum system that is divided by sections. Each section contains categories, each category contains topics. Ex: Administração _ |_Regras da do fórum |_Sugestões e críticas Aeromodelismo _...
asked by 17.02.2014 / 16:35
1
answer

Relationship between state, city, municipality and district

I downloaded an IBGE xml file with data from states, cities, municipalities and districts. I made the split for 4 tables and made their relationships. Follow SQLFiddle My question is: Is this relationship right? Can you still imp...
asked by 15.04.2014 / 05:38
1
answer

MySQL query equal to one value or another

I have a query in a query of MySQL. I have this query select cor from cores where cor in('verde','vermelho'); The problem is that I want the green, and if it does not have green I want the red. but not the 2 results. I can not use...
asked by 05.02.2014 / 12:37
1
answer

Double rule in LIMIT

I have a news table with the fields titulo , conteudo and destaque , the highlight being int (1), is a Boolean value only to check if a news item is highlighted or not, what would you like to do is to select a quantity of news...
asked by 23.12.2018 / 00:06
1
answer

How to execute PHP file from function in JavaScript?

I have the following structure for registering a new MySQL database account (register.php): <?php $con = mysqli_connect("meu_host","meu_user","minha_senha","banco"); mysqli_query($con,"INSERT INTO contas VALUES (" + $id + ", " + $pass...
asked by 25.03.2014 / 04:09
3
answers

How to get ID from another table and INSERT another?

I have two tables: destinations and entry: In the destinations table: dest_id (AI) and destination; In the entry table: id (id), target_id (relative to destination id of the destinations table) I created a query to insert the first...
asked by 11.04.2014 / 02:18
5
answers

Remove letters and special characters in a select

I have in my table the document field with the following data: How do I select only the numbers of these records by removing the letters and special characters? DOCUMENTO CPF-12345698-35 CPF=05604968-34 CPF-:033369328-32 CPF-056904968-31...
asked by 16.05.2014 / 15:10