Questions tagged as 'mysql'

3
answers

How to create a table (empty) from a selection of other tables?

EXAMPLE : I have two tables: table1 : with two columns product_id , product_name ; table2 : With three columns tag_name , product_id , tag_name I would like to create a table3 from a selection of table1 and table2 with...
asked by 09.12.2016 / 13:58
1
answer

Problem with BETWEEN between dates

I need a light for an issue, I have a data filtering system (search) where I have to search for two dates, Initial and Final. Since I have these two columns in the database, then when I execute the search I choose which column I want to filter....
asked by 19.04.2017 / 15:30
1
answer

List records without reference in another table

I have three tables: - Customers - plans - services In the services table I have servico_A, servico_B and servico_C that are listed in the plans table. I need to list all clients that do not have a plan with service_C. Even thoug...
asked by 24.11.2016 / 14:46
1
answer

Error using PDO prepare () function [closed]

I'm in a new project, and I need to use prepare() of the PDO, I do not know why, but only with it that is giving this error, every time it has some function, or some line with prepare() , PHP returns an error. I have already sear...
asked by 17.11.2016 / 07:48
1
answer

Error Code: 1215. Can not add foreign key constraint

Can anyone help me? I can not create this foreign key. Here is my code: CREATE DATABASE escola2; USE escola2; CREATE TABLE IF NOT EXISTS aluno ( matricula INT, nome VARCHAR(25), sobrenome VARCHAR(30), cod_curso VARCHA...
asked by 17.11.2016 / 13:11
1
answer

Reset mysql table automatically

I have a database that stores some leads, can you make the tables in this bank reset every day at a certain time or until it reaches so many lines? I use phpmyadmin in cpanel.     
asked by 28.10.2016 / 19:19
2
answers

Array data dynamically in PHP [closed]

I'm developing a project, in which I need to dynamically retrieve the data that is registered in the database. To read this data, I have this function: // Lê registros function DBRead($table, $params = null, $fields = '*'){ $table = DB_PR...
asked by 20.10.2016 / 23:30
4
answers

Return value in SQL Server query

I need this query to return 2 instead of A. TYPEUSUARY is of type varchar. Can someone tell me where the error is? USE DATABASE SELECT TIPOUSUARIO FROM TABLE UP (NOLOCK) WHERE TIPOUSUARIO = case TIPOU...
asked by 21.10.2016 / 14:21
2
answers

Codeigniter with Modal screen and Registration Response

I'm doing a registration of requests of call through a modal but I can not handle answer of the cadastre: "Successfully register" Controllerclass<?phpdefined('BASEPATH')ORexit('Nodirectscriptaccessallowed');classHomeextendsCI_Controller{f...
asked by 01.06.2016 / 20:01
1
answer

Why does my PHP script only return me Resource id # 4? [closed]

I'm trying to get only the name of a column from a database table, and it always returns only the Resource id # 4, I'm going to send a portion of my code. <?php mysql_connect('localhost', 'root', '') or die ("Erro ao conectar!"); my...
asked by 08.09.2016 / 20:03