Questions tagged as 'mysql'

3
answers

Update records from one table using values from another table

I need to do an update on a table with the value of another table and there are many records so I'm doing it this way, but my query is not working: UPDATE produtos SET produtos.fornecedor = movimentacao.Fornecedor FROM produtos, movimentacao W...
asked by 07.05.2014 / 20:10
1
answer

How to do to see if there is already a record in the database mysql and php [duplicate]

Good afternoon community, I am currently reviewing some concepts of html, php, css, mysql, and I have been building a simple login system with a registration form, through some videos. So far so good, taking the time when I managed to regis...
asked by 11.06.2017 / 16:42
1
answer

Why is my WHERE statement in MySQL not working?

I have the following SELECT, and in the WHERE clauses the amount of credit was only shown if > = 2, but even putting the condition, shows me everything. (fornecedor_credito.qtd_credito >= '2') AND (cadastra_oferta.qtd_estoque >= '2')...
asked by 22.07.2017 / 20:10
1
answer

Script only number

I have a script that only allows typing numbers into input however when I type a phone number and saved in the database. The number is saved all scrambled. Example: I type in input 27998439197 and in the database it saves as 214...
asked by 27.11.2017 / 13:50
5
answers

How to draw readonly from input

I'm trying to make clicking button btnEditar free inputs : funcionário , rca and regiao ... I used this script but it did not work: <script language='JavaScript'> $('document').on('click','#btnEdi...
asked by 29.11.2017 / 11:17
4
answers

How to return the sum of column business_value, month by month, based on column start_date?

I have the following table: IneedanSQLstatementthatreturnsthesumofthebusiness_valuecolumn,monthbymonth,basedonthestart_datecolumn.Example: I need the name of the month and the total to appear.     
asked by 03.11.2017 / 13:56
2
answers

Why does hibernate not list results if the select query calls null field of the table?

I have a Class-Entity Product. @Entity public class Produto implements Serializable{ @Id @GeneratedValue private long id; @Column(length = 70, nullable = false) private String cod; @Column(length = 100, nullable = f...
asked by 15.09.2016 / 18:57
2
answers

Perform multiple operations on a single SQL code

I have a table in MySQL as follows and structure: I would like to execute a SQL query that would do the following operations: Total number of records ( total1 ); Count how many records have id_nps_answer between 0 and 6 ( total2 )...
asked by 03.11.2018 / 16:40
1
answer

mysqli_fetch_assoc () - PHP

How does the mysqli_fetch_assoc function work? Example, if I use it in a function as below in PHP. What does it do? function buscar_tarefas($conexao){ $sqlBusca = "SELECT * FROM tarefas"; $resultado = mysqli_query($conexao, $sqlBusca...
asked by 25.10.2018 / 15:37
3
answers

Insert data Database Related tables

I'm having trouble inserting data that has related tables. $sqlinsert2 = "INSERT INTO tb_detalhe_trabalhador VALUES(0,NULL,NULL,'".$MedicaValidade."',.. Currently the data that is NULL is the fields related to the Table. tb_detail_worker...
asked by 24.02.2014 / 13:24