Questions tagged as 'mysql'

1
answer

Pagination script PHP [duplicate]

I would like to know how I can perform pagination in PHP (in this case 10 items per page). The display is being made this way: <?php foreach($pdo->query('SELECT * FROM videos ORDER BY id DESC') as $c): ?> <li> &...
asked by 27.10.2015 / 15:49
2
answers

Deleting data automatically after a certain time

Example: I have a table with three fields: id int pk, varchar name, int category The category field can receive 2 values: 1 and 2; By default always when a data is entered it will have a category 1. What I want is this. When a data is e...
asked by 27.11.2015 / 20:32
3
answers

How to determine the ordering of accented characters in MySQL?

My table uses "utf8-general-ci" so all accents are OK. But when I have for example Aa, Ac and Ab and I want to filter "alphabetically", the result is: Aa Ac Ab On Excel, the result is: Aa Ab Ac Which is more logical. How...
asked by 19.02.2015 / 19:45
1
answer

Backup of all tables except one

In MySQL we can perform terminal backups as follows: Database mysqldump nomeBaseDados > meuFicheiroBackup.sql Table mysqldump nomeBaseDados nomeTabela > meuFicheiroBackupDaTabelaX.sql How can I back up all tables in my nome...
asked by 17.10.2014 / 21:28
3
answers

How to group records by time zone?

I have a table in MySQL, which stores the visits on my site, taking as fields: id | ip | date , with date of type DATETIME . What I need is to separate these visits by peak times. Example: Das 10:00 às 12:00 | 500 visitas Da...
asked by 16.03.2014 / 22:29
2
answers

Date of database returning 31/12/1969

I have in my script a call to date and to start for me brings me a date of 12/31/1969, not the date that is in the database. data. This is my Code: @$pag = "$_GET[pag]"; if($pag >= '1'){ $pag = $pag; }else{...
asked by 30.09.2015 / 20:03
1
answer

How to do to bring table with data when returning from an insert

I have edited the post question because I consider it to be the most logical solution to the question. I have a page with 3 tabs and in one of these I upload files to my hosting and send the necessary information to the database, I am adding an...
asked by 30.07.2015 / 00:24
3
answers

How to manipulate large volumes of data in a database?

I have a process that I need to implement on my system which, at a certain point, will check a relatively large number of data and, if it does not find it, should save to the MySQL database. I'm not finding a way to do this without overloading...
asked by 30.05.2015 / 22:52
1
answer

"Incorrect datetime" value in MySQL

Hello, I'm trying to insert dates in dd/mm/Y format into two jTextField , in MYSQL, however I get an error message only for the first field: Incorrect datetime value: '01/01/2016' for function str_to_date The java code is: if...
asked by 25.11.2016 / 11:18
1
answer

Compare COUNT of two tables

I have two tables and should I return the table total with more data, I'm doing this: SELECT CASE WHEN ((select count(*) as 'familiar' from tb.familiar)) > ((select count(*) as 'personal' from tb.personal))...
asked by 19.10.2016 / 17:54