Questions tagged as 'mysql'

1
answer

ORDER BY only day without time

In MySQL I have a column timestamp called dia_cadastr o (2016-06-21 11:27:32), in the query I want to give a ORDER BY only on the day, and disregard the time. That is, if they have products registered the same day, then it g...
asked by 24.06.2016 / 15:07
2
answers

What is faster, access data in file or database?

In performance, which method is faster to recover data, 1) read a file (which will be generated only once with PHP) or 2) get this data from a database? This data will always be displayed on the page in question. So far I'm using a .json...
asked by 29.12.2014 / 18:39
3
answers

How do you join data from another table

How to merge data from another table. On the downstairs bank I have 3 tables: dados: id, nome, end, tel... etc.... cidades: id, nome_cidade status: id, nome_status $sql = "SELECT * FROM dados "; $resultado = mysql_query($sql) or di...
asked by 26.01.2015 / 02:21
3
answers

Convert date of type 2016-10-04 15:51:16 to, 04-10-2016 15:51:16 in SQL or PHP how to do?

I am doing a job to show the date and time of the insertion in the script in the database, I have to show the date in dd-mm-yyyy format and then the time, how can I do this by the SELECT of the script or by the PHP? If so, how can someone help m...
asked by 10.10.2016 / 16:58
2
answers

What is faster to read and edited, a database or a .txt?

It would be to store and rewrite only 1 INT digit, deleting one and typing another, on condition that when it reaches 5, go back pro 1, and go doing that loop every time someone accesses. Whenever someone accesses the page, the value would...
asked by 28.11.2016 / 04:38
6
answers

How do I use a database in an HTML site?

I am interested in making a website that will use database, many told me that if you use MySQL to do this, however I have no knowledge about it, installation, use etc. I have knowledge in PHP, HTML, CSS and JavaScript, I do not know if it interf...
asked by 04.02.2014 / 19:57
2
answers

How do I get the position of a user individually in a rank, if in the database I only have your score?

With the code below I can display all users, because I put DESC and variable $num and it increments the placement with $num++; . But what if I want to get the / rank from the guy who is logged in ($_SESSION) and n...
asked by 30.04.2014 / 18:24
1
answer

Accessing MySQL with C #

I am creating a simple Form that has 3 TextBoxes and 3 buttons and I want to save the information entered in Textboxes in a table. I have already created querys all within a class acessoBD , but I can not acc...
asked by 24.09.2015 / 03:00
1
answer

Differences between Natural Join and Inner Join

What characteristics differentiate a query performed using Natural Join from another with the use of Inner Join ? Is there any performance related question or any other condition that leads me to choose one over the other? For th...
asked by 21.03.2015 / 15:53
2
answers

Difference between the Alter Table Foreign Key

I would like to know the difference between the execution of the Alter Table clauses when entering the ADD CONSTRAINT , for example by executing the following code: ALTER TABLE Orders ADD FOREIGN KEY (PersonID) REFERENCES Persons(...
asked by 31.03.2017 / 22:00