Questions tagged as 'mysql'

1
answer

Doubts about MySQL integration with Java

I am creating a system in NetBeans, using the Java language and the MySQL database. I wrote the following code to make the connection between the program and the database: public class Conexao { private static final String DRIVER="com.mysql.jd...
asked by 21.12.2016 / 13:56
2
answers

BIT (1) versus TINYINT (1) for Boolean values

I may be wrong, but I get the impression that, in practice, the default in MySQL is to use columns of type TINYINT(1) to store boolean values, true / false or 0 / 1 . Only TINYINT accommodates up to 1 byt...
asked by 18.01.2016 / 13:33
1
answer

What is the advantage of using the ENUM type?

When I use type ENUM because until today where I saw this type being used it could be replaced with VARCHAR or even with a simple CHAR , I can not see a case where it really is needed ? A practical example would be useful.  ...
asked by 21.08.2015 / 13:01
3
answers

Uppercase in the first letter of all the words of a column in MySQL

How do I make the first letter of all words in a specific column be converted to uppercase using pure MySQL p> Example: gustavo silva Guilherme souza joão Silva maria souza To: Gustavo Silva Guilherme Souza João Silva Maria Souza...
asked by 30.06.2015 / 06:29
4
answers

How to sort the data of a query by default values?

Using as an example, I have a certain table of users, where the city of that user is, is a reference to another table. I need the order of these users in a query to be given according to the location of the current logged-in user. For example...
asked by 14.09.2015 / 21:53
1
answer

Multiple-step form, losing values of variables when page changes

We have three PHP pages with html form. In the first page we have the fields showing the values of the variables and the hidden fields containing the values of the variables like this: <input name="nome" type="hidden" value=".$nome." >...
asked by 14.03.2014 / 04:17
2
answers

What's the difference between SOME, IN and ANY?

What is the difference between SOME , IN and ANY in MySql and when should I use them? Do they perform poorly if used many times in the same SELECT ?     
asked by 16.04.2015 / 22:01
3
answers

How to get the format in hours when it exceeds 24?

I'm developing a system in PHP where I need to at some point get the total time of an audio file. This time is saved in the database in seconds and also in the time format. The problem is that when you format these times through the seconds s...
asked by 24.02.2015 / 02:54
2
answers

How to check real-time change in database with php websocket?

I want to update a div only when there is a change in a certain field in the database, I am currently using polling, but I want to switch to websocket for performance issues, but I only find examples of chats, and it's not what I need. Does any...
asked by 29.03.2017 / 17:55
3
answers

How to know how many Sundays have the months of the year php mysql

Let's say the year is: 2016  I need to know how many Sundays have the months of the year and record and result in variable php.  Reason:  I need to pass a condition, for example: if ($dom_mes == 4 ) { //CONDIÇÃO A } elsei...
asked by 21.10.2016 / 15:48