Questions tagged as 'mysql'

3
answers

How to browse tuples for an ID and check their values?

In a table where I record the number of parcels and the situation of each parcel, I need to go through it and find the sales orders where all parcels are paid. Ex: SELECT * FROM tabela_parcelas WHERE ID = X Return: ID Parcela | S...
asked by 20.10.2014 / 22:45
2
answers

str_replace using arrays

I want to negate the searched terms in the results, but when I use explode , and I try to use str_replace , I get an array back. <?php $search_term = filter_var( $_GET['s'], FILTER_SANITIZE_STRING ); $palavras = explode( ' ',...
asked by 10.10.2014 / 19:03
1
answer

MySQL and PHP comparison SUBQUERY

I made a query to select all the user records of a table, but I inserted a filter where the admin selects the state and filters only the user records of the selected UF, but is giving return error. <?php if( !isset( $_GET['uf'] ) ) { ## As...
asked by 04.10.2018 / 15:58
1
answer

AdonisJS - Generate database code already created [closed]

I have a question. I would like to know if it is possible. I have a mysql server already running a template of mine, with tables already created and their fields. Is there a way to connect a Node project, Adonis, and take advantage of my Mysql t...
asked by 10.07.2018 / 03:29
2
answers

How to insert multiple records with 1 insert? [duplicate]

I need to insert multiple records with an insert Example: $ ids="1,2,3,4" $conn->prepare("INSERT INTO documento (id) VALUES (1)"); $conn->prepare("INSERT INTO documento (id) VALUES (2)"); $conn->prepare("INSERT INTO documento...
asked by 30.06.2018 / 02:10
2
answers

How to refresh the page without forwarding information to the database in php

I'm working on a simple messaging system, and it's up until it works, however whenever a refresh is given on the page the information from the last insert is forwarded to the database. And if nothing has been filled, and given refresh it simply...
asked by 29.06.2018 / 21:15
1
answer

Convert MySQL database from latin1 to utf8

I have a MySQL database that is currently set to charset latin1. When I make a select in a table, for example: SELECT nome FROM acolhidos The accented characters appear like this: ALESSANDRO ROGÉRIO MOTA DA SILVA DANIEL MENDONÇA NOVAES...
asked by 29.06.2018 / 14:55
1
answer

Select for a specific period in MySQL

I know that if I want to query the date 5 days ago, I use the following Query: SELECT * FROM Tabela WHERE Data = DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 5 DAY); Or want to go back two months ago I replace DAY with MONTH...
asked by 26.09.2018 / 20:01
1
answer

Search only mysql

I'm doing a search in db that needs to return the sum of a field and the last corresponding value, and grouping them to an index Query $stmt = getConn()->query("SELECT senha,movi,SUM(entrada) as entrada,custo FROM estoquemovimento ORDE...
asked by 04.07.2018 / 16:57
2
answers

group columns in mysql

You have these insert in the table I'd like an sql and it returns me the team total points type: time - points Uruguay - 9 russia - 6 arabia - 3 Egypt - 0     
asked by 03.07.2018 / 02:34