Questions tagged as 'mysql'

9
answers

How to prevent SQL injection in my PHP code?

I developed a page in PHP for internal use of the company I work with and only very few people use it. You can use this page to do some queries, insertions, changes and deletions of a table in a MySQL database, however I believe that my PHP code...
asked by 03.02.2014 / 13:37
0
answers

Mysql does not return timediff value

Good afternoon, I am putting together a trigger in which I need to return the difference between two DATETIMEs. I'm trying to use the code below, but mySQL does not return anything. If I run Select directly it returns without assigning a variabl...
asked by 27.11.2018 / 17:01
0
answers

Query in mysql grouped by hour

Good afternoon. I'm doing a query in mysql and it returns the precise values. My problem is to display values that do not return eg: I asked to group by hour or by day it only returns values that are data. Since values that do not have data a...
asked by 27.11.2018 / 15:54
1
answer

Insert in two different tables

I have two tables ( cliente and telefone ), I need to insert the name in the cliente table and the client phone in the telefone table, at the same time, by the same form. In the HTML form I was able to put all the f...
asked by 15.11.2018 / 08:16
0
answers

Problems with C3P0 properties

I noticed the following information in the console: WARN: HHH000022: c3p0 properties were encountered, but the c3p0 provider class was not found on the classpath; these properties are going to be ignored. hibernate.cfg.xml (Java Resources /...
asked by 06.11.2018 / 17:41
0
answers

Create a foreign key with two varchar fields

I'm finding it very difficult to create a foreign key between two tables, whose type is varchar : ALTER TABLE netmap ADD CONSTRAINT fk_IP FOREIGN KEY ( IP ) REFERENCES ipvalidos (IPS); The error is:    Failed to execute SQL:...
asked by 06.11.2018 / 19:21
0
answers

Error creating ADO.NET Entity Data Model file

Good morning, I am trying to create an ADO.NET Entity Data Model file, with connection to the MySql (Workbench) database, however or from the error, or the Entity Data Model screen closes. So I have two scenarios: 1) I create my MVC projec...
asked by 06.11.2018 / 16:25
1
answer

How to do a recursive query with stored relations in a JSON array?

I have a MYSQL table that relates to itself. The relationships are represented in the same table by JSON Array . Here is the table and some sample data: CREATE TABLE 'templatedata' ( 'Id' char(255) NOT NULL, 'RelatesWith' json DEFAUL...
asked by 07.11.2018 / 11:51
0
answers

The provider for MySqlClient of the Entity Framework can not be loaded, in ASP.NET application

I did some studies on American StackOverflow regarding this case and I was not successful. When I try to access my link page, I get the message below:   The Entity Framework provider type 'MySql.Data.MySqlClient.MySqlProviderServices, Entit...
asked by 04.11.2018 / 17:46
0
answers

Add to SQL or PHP for better performance and less weight on the server?

I am working on a voting system (5 star ratings), and I want to get the total vote amounts divided by 5 and 1 to show the percentage of each note. However I could do a select already with the sum of everything as ex: SELECT SUM(rating = '5') a...
asked by 09.11.2018 / 00:21