Questions tagged as 'mysql'

3
answers

PDO Paging - Fatal error: Out of memory

I'm doing a paging, but it's generating a memory error. Is there any way to optimize or fix the crash? Or is it on the same server? Note : php.ini is set to 512 in memory. if (!(isset($_GET['pagenum']))) { $pagenum = 1; } els...
asked by 12.11.2015 / 19:28
2
answers

Retrieve parameter for SQL filter: date and time every minute [closed]

I have a table with a column named values and it has the following columns: ID, VALUE and DATA. I have while in PHP that counts 24 hours, so I need to recover the records every 30 minutes. I need the parameter to query 30 in...
asked by 24.08.2016 / 15:46
2
answers

Function with CAST and SUBSTRING

This function would be to return the last two "955 12 " or to return the number without the last two digits " 955 12". The value passed to function can vary by at least 3 characters and at most 11 DELIMITER $$ DROP FUNCTION IF EXISTS sub...
asked by 22.07.2015 / 17:50
1
answer

Compare Date within Mysql

I'm trying to select the date closest to the current date, but I'm not getting a good result. The insertion is: $titulo = trim($_POST["titulo"]); $descricao = trim($_POST["descricao"]); $data = $_POST['data']; the query is: SELECT * FR...
asked by 20.07.2015 / 15:11
2
answers

Date fields entered with value 0000-00-00

I am not able to save the dates of a form in my DB, the variables are correct, since I can view them before sending them to the database, but when sending to DB it goes in the format 0000-00-00 , this is zeroed . The code I have is this:...
asked by 17.07.2015 / 14:37
1
answer

Pulling information from a table to a news page

I have a news page that pulls by id (it's one of those noticias.php?id=1 ), but I wanted it to tell only the comments of the news I'm reading, not all of them. Is this possible? I already got PHP to count, but I wanted to give th...
asked by 26.07.2015 / 02:36
1
answer

Increase PHP / MySQL script performance

Good Afternoon Currently, I have a script in PHP that leads a CSV file of 6801 lines, and performs an INSERT as long as there are records. I'm currently able to insert 19 records per second. In addition to this INSERT routine that runs eve...
asked by 17.07.2015 / 21:44
2
answers

Query with JOIN in 3 tables

I have the following tables: livroautor id idautor idlivro ------ ------- --------- 1 1 (NULL) 2 2 2 3 3 3 4 4 4 5...
asked by 08.08.2017 / 00:02
2
answers

Select category and subcategory within the same table

I have the table called modulos and inside it I include idModulo, idModuloBase, module, folder and datacriacao When the idModuloBase is 0, it is the category, if it is > 0, is the completed module. I need to do a SQL that lists the...
asked by 15.07.2015 / 19:07
2
answers

Query Between MySQL does not return correct!

I have a simple query in a Datetime field, I have to query two dates, of course retrieving the values between them. select financ_conta_id, financ_conta_cadastro from financ_conta where financ_conta_cadastro between CURRENT_DATE()-3...
asked by 21.07.2016 / 13:55