Is there a limitation to the length of the query in mysql?

Posted by Bakhtiyor on Stack Overflow See other posts from Stack Overflow or by Bakhtiyor
Published on 2010-06-11T20:46:59Z Indexed on 2010/06/11 20:52 UTC
Read the original article Hit count: 129

Filed under:
|
|

I am asking this question because I need to know this limitation as I am generating SELECT query in my PHP script and the part of WHERE in this query is generated inside the loop.
Precisely it looks like this

 $query="SELECT field_names FROM table_name WHERE ";
 $condition="metadata like \"%$uol_metadata_arr[0]%\" ";
 for($i=1; $i<count($uol_metadata_arr); $i++){
    $condition.=" OR metadata like \"%$uol_metadata_arr[$i]%\" ";
 }
 $query.=$condition;
 $result=mysql_query($query);

So, that's why I need to know how long my $query string can be, because the array *$uol_metadata_arr* could contain many items.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql