Questions tagged as 'mysql'

1
answer

Select with LIKE and POST

Hello I'm trying to use a LIKE in a SELECT, the data came via GET, but it does not work, what could be wrong? $nome = $_GET['nome']; $row=$db->prepare("SELECT * FROM cadastro WHERE nome LIKE '%$nome'%"); Thank you     
asked by 15.05.2017 / 14:07
2
answers

Distinguish equal fields in a SELECT with LEFT JOIN

In SELECT done in two tables with similar fields I'd like to distinguish the field from each table when it shows the results. For example: $sql = BD::conn()->prepare("SELECT a.*, b.* FROM tabela_a a...
asked by 24.02.2017 / 14:12
1
answer

Query MySQL grouping results in case

I have the following query: SELECT DAY(o.data_fechamento) AS DIA, u.nome AS TEC, COUNT(*) AS TOTAL FROM ocorrencias AS o LEFT JOIN sistemas AS a ON a.sis_id = o.sistema LEFT JOIN localizacao AS l ON l.loc_id = o.loc...
asked by 27.04.2017 / 23:54
1
answer

Insert MySQL data with .txt file

I have the following somewhat simpler file:    new_user.txt JOAO|18|JOAO VITOR BARBOSA|MANDAQUI ROGERIO|38|ROGERIO JOSE DE BARROS|CAPAO REDONDO My table in the database was created as follows:    users create table users ( pri...
asked by 10.02.2017 / 13:18
1
answer

How to give permissions for all MySQL users at the same time?

I have a database that all MySQL users should be able to access. I've already tried GRANT ALL PRIVILEGES on nomedobanco.* to '%'@'%' identified by , but to no avail. How can I do this?     
asked by 10.02.2017 / 18:27
2
answers

How do I get all the data in a table based on another table?

I have a countries table and another table with continents that has FK as the id of the countries table and I needed to return all the countries in Europe. Can anyone give a help on how to do this? Thank you in advance. This is the structure...
asked by 20.10.2015 / 15:39
1
answer

Import data from Mysql to Excel

I want to import data from Mysql to excel using Python, when I try to make it a tuple error. Can anyone with more experience help me? I followed the code and the error: # coding=utf-8 from Tkinter import * from os import popen import tkM...
asked by 21.09.2016 / 19:11
1
answer

Backup by mysqldump line by line

I am using mysqldump to export only the data from my database, but when exporting, it shows only one line with all the inserts. Is it possible to do one record insert per line? Ex: INSERT INTO TABELA() VALUES(); INSERT INTO TABELA() VALUES();...
asked by 17.10.2016 / 22:26
2
answers

Error in CRUD command UPDATE - java.sql.SQLException: No value specified for parameter 8

I'm building a Java system with MySQL database connection, but I stopped at some point because I can not find the error. My update method happens an error in JUnit, but I can not figure out what it is. Follows parts of the code: package com...
asked by 17.12.2016 / 20:36
1
answer

Indices in primary key columns

I know that each case is a case, and that there are no ready rules about creating the indexes. In my case, since the primary key for each table in my database is used in wheres of my queries to the database, should I create an index for t...
asked by 13.08.2016 / 04:04