Questions tagged as 'mysql'

2
answers

In an MVC structure, can we create a model that represents a View (SQL)?

I was arguing with a friend of mine about using views (say MySQL, not the pattern MVC). A question arose in the following way: A Model serves to represent a data structure, being able to read and write data in a table through it. So, co...
asked by 14.09.2015 / 19:12
3
answers

How to create search in MySQL that returns unmatched rows?

I'd like to know how I can do a search that returns records that are not part of the search condition. For example, consider the situation where there is a database of a movie store with the cliente table and the aluguel table....
asked by 24.01.2016 / 05:18
2
answers

How to make a random query in MySQL without repeating data?

I'm creating a Pinterest-type image-type site that, in addition to other things, needs to combine the following features: Infinite Scrool (I'm applying this code here: link ). A menu to choose in which order to display the images....
asked by 04.09.2018 / 03:16
4
answers

Perfomance in MySQL with InnoDB in large data table

I currently have a table with about 6 million records that in turn perform a lot of I / O operations, so in designing the project I chose to use InnoDB instead of MyISAM in MySQL, after all, lock would be per page, not per table. But I ha...
asked by 29.01.2014 / 23:31
3
answers

Post a comment and view follow without refreshment

Updated 5 Good morning, I'm trying to create a comment system that is equal to link > Here is the JavaScript code to send everything to PHP: $(function() { $('.commentform').submit(function() { var comment_publica...
asked by 05.05.2015 / 21:42
3
answers

Difference between decimal and numeric

The two data types, DECIMAL and NUMERIC , are / can be used to store exact values. For example: Is there any difference between Salario DECIMAL(5,2) and Salario NUMERIC(5,2) in MySQL? Is there a situation that...
asked by 13.03.2015 / 03:28
1
answer

How to define pre-defined types in MySQL?

In the site I'm developing, I'll have, for example, a registration form where the user must define their gender in a combobox (male or female). The users table in the database will have all user fields as string , date , float...
asked by 16.08.2015 / 19:04
2
answers

How to refresh page and not send duplicate data to the bank in PHP?

I would like to know if someone has an example or can explain me in the following question: In case the user refreshes the page, after submitting the first form, the data is not sent back to MySQL. My application is in PHP, I already resea...
asked by 03.03.2015 / 02:23
5
answers

How can I add a value to a row in bd without having to add variables?

Well my question is like this: I have the row balance of a given user of my database table that has 100 €, and I wanted to add + 50 €, as I can do without having to create a variable with his current balance, plus a variable with the balance...
asked by 20.07.2016 / 15:33
3
answers

How to fill a value object automatically in php?

I need a method that autocompletes my VO by getting a result set from the mysql database and the PDO class from php as a parameter. Example VO class Pessoa{ public $nome; public $idade; } The idea is to incorporate this fill...
asked by 09.05.2014 / 21:05