PHP Remove LIMIT from MySQL Query

PHP remove LIMIT from MySQL query. If the query is automatically limit to so much rows and you want to prevent the tool from imposing this limit or you just want to totally delete it. Here’s a simple code to do it.

Removing LIMIT from MySQL query:

$pattern = '/LIMIT.\d/';
preg_match($pattern, $query, $matches);
$query = str_replace($matches[0], '', $query);

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>