Questions tagged as 'mysql'

1
answer

Code to show procedures in MySQL [closed]

What is the code in MySQL to show the procedures created by me?     
asked by 10.10.2016 / 00:27
1
answer

How to configure charset = utf-8 in Mysql?

I'm trying to set charset=utf-8 in MYSQL, but I can not find it in the my.ini file. Which file do I set up?     
asked by 07.07.2016 / 22:09
1
answer

How to do select auto relationship N: N

I am not able to perform a SQL query with N: N relationship. I have a user table and one with user_has_usuario self-relationship, which will be registered responsible and students (from a school) would like to list the students by the CPF of the...
asked by 23.12.2016 / 20:22
2
answers

How do sql for a field in a non-primary table become foreign in another table?

CREATE TABLE PESSOA ( ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, CPF VARCHAR(15) NOT NULL, RG VARCHAR(10) NOT NULL, NOME VARCHAR(128) NOT NULL, DATA_NASCIMENTO DATE, PRIMARY KEY (ID) ) CREATE TABLE CADASTRO (...
asked by 13.05.2016 / 21:01
3
answers

Problem in query with Between in MySQL?

In an input and output control system there is a cad_entrada_saida table where you have two columns in the dEntrada and dSaida database, these two columns are as varchar , and writing the data in the format dd/mm/yy...
asked by 03.05.2017 / 04:54
2
answers

Insert if it does not exist or Update if it already exists in Mysql?

How can I give MySql a INSERT or a UPDATE if the line in question already exists or not? I tried the following but it did not work: IF EXISTS (SELECT * FROM configs WHERE id_serie = :id) UPDATE configs...
asked by 28.04.2017 / 16:59
2
answers

Parameter error in MySQL with C #

string sql = @"UPDATE ivendas SET nritem=(@rank:=(@rank+1)) where id_venda = 20"; try { MySQLBase basemysql = new MySQLBase(); MySqlCommand cmd = basemysql.connection.CreateCommand(); cmd.CommandText = sql; cmd.CommandTimeout = 10...
asked by 16.01.2018 / 18:37
2
answers

Export query result sql server to txt file on apache server automatically

I make the following query from my apache server on a SQL SERVER database: <?php // Dados do banco $dbhost = "192.168.0.100"; #Nome do host $db = "DATABASE"; #Nome do banco de dados $user = "root"; #N...
asked by 16.01.2017 / 15:42
2
answers

replace id by name

I have a table called sale and in this table I insert some data from another table until everything blz, my problem and at the time of showing this data when I do an echo on the screen does not appear the name of the product but yes his id and I...
asked by 16.12.2015 / 13:18
1
answer

Add Wordpress user in more than one role

I'm developing a plugin for members area in WordPress and I'm going to control this access through the roles functions. Assuming I create the functions: content1, content2, and content3. How would I be able to assign more than one role to a...
asked by 23.11.2016 / 19:12