Questions tagged as 'mysql'

2
answers

SQL Command in String MySQL

I'm doing a procedure that holds a select in a varchar variable. Now I need to run this sql command, how do I do this? I'm using MySql. Procedure: delimiter $$ create procedure eixos_caminhao (in numeroEixos int) declare comando varchar(500);...
asked by 09.10.2018 / 17:42
3
answers

Is MySQL built into EasyPHP? [closed]

I use EasyPHP and installed only it, PhpMyAdmin works perfectly and I can perfectly manipulate the tables. Is the MySQL installation already built into the localserver that I use or something like that? Do I need to install any other softwa...
asked by 07.12.2015 / 03:27
2
answers

Delete sectors and their descendants - PHP

I have the following table structure: CREATE TABLE IF NOT EXISTS 'setores' ( 'set_cod' int(10) NOT NULL AUTO_INCREMENT, 'set_base' int(10) NOT NULL, 'set_setor' varchar(50) NOT NULL, 'set_data' timestamp NOT NULL DEFAULT CURRENT_TIMEST...
asked by 08.08.2016 / 21:46
2
answers

I can not insert the values in the table with auto_increment in the primary key

This is my table: CREATE TABLE Utilizadores( IDUtilizador INT NOT NULL AUTO_INCREMENT, PNome VARCHAR(2000) NOT NULL, UNome VARCHAR(2000) NOT NULL, Email VARCHAR(2000) NOT NULL, PalavraPasse VARCHAR(2000) NOT NULL, TipoUtilizador VARCHAR(2000)...
asked by 20.05.2016 / 20:10
4
answers

Searching for dates via BETWEEN AND [duplicate]

I have the following situation, where when trying to query a date until another date using BETWEEN , the specified date does not return, just "the previous day". Is there any outline to resolve this issue? Following the dates saved in...
asked by 15.04.2016 / 14:03
2
answers

Pass parameter in View

How do I pass a parameter to a view in MySQL? Using SQL Server just put WHERE u.nome = @nome that would solve the problem. Here is the view of the problem in SQL: CREATE VIEW 'view_conta_pessoa' AS SELECT p.nome, p.email FROM conta...
asked by 21.07.2015 / 21:31
2
answers

How to avoid multiple inserts in the database

Hello, I would like to know how I can use php to avoid adding the same item to a database on a save page that adds the names of subcategories if I update the browser. Since I can not use the Unique in the subcategory table in the name field,...
asked by 21.07.2015 / 13:54
2
answers

Define roles for users stored in Bank

How to structure a user roles structure (common users, businessperson, site_amdin) in the database, each user will have different functions, powers in the application that will use this database. User table: CREATE TABLE users ( id INT...
asked by 15.07.2015 / 14:49
1
answer

Now () MySQL does not display the correct time

I need some way to insert the EXATA time from the server who sends a message to the database. I'musingtheNOW()functiontoregisterthemoment:"INSERT INTO 'chat' (id_de, id_para, data, mensagem, hora) VALUES('$id_de','$id_para',NOW(),'$mensagem...
asked by 14.07.2015 / 13:51
1
answer

Why does ORDER BY RAND () leave the query slow? Is there another alternative?

I had just asked questions about ordering random values through MYSQL . From there I began to notice an uncomfortable slowness in the system of friendships suggested here by the company. I use Laravel 3 . I went to do a check o...
asked by 17.09.2015 / 15:57