PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, January 15, 2022

[FIXED] Allowed memory size exhausted when I use "OR"

 January 15, 2022     mysql, phpmyadmin, sql     No comments   

Issue

In my database, I want to filter the data by date : I have multiple checkbox for that. When I check 2018-2019 for example, I want to get every information between '2018-09-01' and '2019-08-31'. I managed to do that. What I can't figure out how to do is when I check two of the checkbox.

I tried using OR by doing something like that :

AND (date_conseil BETWEEN '2018-09-01' AND '2019-08-31') 
OR (date_conseil BETWEEN '2017-09-01' AND '2018-08-31');

But I only get an error "Allowed memory size of 268435456 bytes exhausted (tried to allocate 4096 bytes)". I really have no idea why I get this and why my SQL doesn't work.

Can you maybe give me a little help ? Thanks


Solution

Use like this, look the ( ) and the OR, it is inside pharentesis.

AND (date_conseil BETWEEN '2018-09-01' AND '2019-08-31' 
OR date_conseil BETWEEN '2017-09-01' AND '2018-08-31');


Answered By - Roy Bogado
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing