Questions tagged as 'mysql'

1
answer

how to create search system using filter

I have a search system where I search the users by filtering by: name, age and email. If I filter by name and age and email, everything happens fine, but if I filter only by age, for example, nothing is returned even though I try to bank the cor...
asked by 10.09.2017 / 06:01
1
answer

Compare different value, value "null" does not enter the backup

I have a table of files, and there is a field called "document_type", which is filled with 1 or when it is not filled becomes NULL, the problem is that when I give SELECT and I use the comparator to return all results with type_document o...
asked by 27.08.2017 / 18:55
0
answers

Refactor a database using VIEWS

I have the task of refactoring a database and would like to know if VIEWs are feasible for the task. My strategy is to create a VIEW by imitating the new structure of the supposed table, at least the name of the table (name of V...
asked by 05.09.2017 / 19:42
1
answer

Connection Error mysql_query

#include <mysql/mysql.h> #include <iostream> MYSQL connection; void data_insert(); int main(){ mysql_init(&connection); if(mysql_real_connect(&connection,"localhost","root","irineuvocênãosabenemeu","teste",0,NULL,0...
asked by 08.09.2017 / 19:52
1
answer

How to remove duplicate lines efficiently?

I'm normalizing a table here and found that there are duplicate rows. The way I chose to clean these lines is through: CREATE TABLE tabela_nova AS ( SELECT DISTINCT * FROM tabela_antiga ); The problem this way is that it is very slo...
asked by 10.06.2015 / 01:56
0
answers

Return data from a function?

How do I get data from a function, in case I want to make a foreach of an sql query that is in a function: index.php <?php require_once "funcs/functions.php"; $userdata = get_user_data(); foreach ($userdata as $d) { $name...
asked by 27.08.2017 / 01:45
3
answers

error entering data in php database

I'm doing a page in html with the checkboxes to insert into string form inside a table row, but if I do not mark all the options it gives an error (but inserts into the bank), how do I get rid of this error if in case I choose only one value fro...
asked by 26.08.2017 / 18:26
1
answer

Report Viewer Error and Mysql: Visual Studio Enterprise 2017

In this case the Mysql database did not appear in the Report Viewer list after I managed to install Mysql for Visual Studio 1.27 in the case at the end of the process of linking the table with the database with the following error: Failed to...
asked by 26.08.2017 / 20:19
1
answer

Print dynamic query

I have a query on a system where the user selects the month and the corresponding records are shown on the same page. I want to print the result of the query but as the form sends via GET: <form action="" method="get" id='form-contato' clas...
asked by 21.08.2017 / 11:31
0
answers

XML accent failed for mysql

I'm facing a strange error with accentuation. I set my bank, table and structure to UTF-8. I use: header('Content-Type: text/html; charset=utf-8'); mysql_query("SET NAMES 'utf8'"); mysql_query('SET character_set_connection=utf8'); mysql_query(...
asked by 20.08.2017 / 19:33