Jump to content

Max Query Size


johnsmith153

Recommended Posts

(1.) Is there a limit to the length of a sql query I can use in MySQL? I have an array of id numbers (could be up to thousands). I want to delete all these id numbers from a table. I.e. query something like:

$sql = "DELETE FROM tableName WHERE 1 LIKE 2";
foreach ($array as $a) {
  $sql .= sprintf(" OR field LIKE '%s'",mysql_real_escape_string($a));
}

- Is this the best way?

- What if I had thoudands of id numbers to delete. Will the query length be an issue?

- Will any PHP.ini settings affect size of query allowed?

 

(2.) Which PHP.ini settings will affect size of database data returned? Previously to now I have only changed "memory_limit". There are occasions when I dump a whole load of database data to PHP. Do I need to change anyting else to allow a database dump of 1 million records?

 

Link to comment
https://forums.phpfreaks.com/topic/179349-max-query-size/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.