[PHP] Got a packet bigger than 'max_allowed_packet' bytes

2010-02-01 Thread saeed ahmed
i have write a script which search few element from a database. I use a text
file as input.

input file contains these kind of data

clubhouseforkids.com
cairouniversity.com
501c3nonprofit.com
mrbling.com
cellsocket.com

this is the scripts for read the file data

/**/
$file = fopen(files.txt, r) or exit(Unable to open file!);

 while(!feof($file))
 {
 $data[] = stream_get_line($file, 100, \n);
 }
 fclose($file);
//

this script worked fine for small size of file. but if i use a large size
like 900KB then its show Got a packet bigger than 'max_allowed_packet'
bytes .

where I'm doing wrong? please help me out there...


-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


Re: [PHP] Got a packet bigger than 'max_allowed_packet' bytes

2010-02-01 Thread Rene Veerman
yea, try executing the sql statement

set global max_allowed_packet = 500 * 1024 * 1024;

from php?? (note; it sets it to 500mb)

not sure if your mysql server will allow this.

on shared hosting, you can expect they disabled the ability to change
it from php..


On Mon, Feb 1, 2010 at 10:27 PM, saeed ahmed saeed@gmail.com wrote:
 Thank you, I also think so its a mysql problem.

 anyway do you have any method for increase the max_allowed_packet from a php
 script?



 -
 Regards
 Saeed Ahmed
 http://saeed05.wordpress.com
 -

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php