Hi, I'm getting this error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 576 bytes) in 'path' on line 207
what I'm doing is getting an excel file with about 8000+ rows and trying to move them into a table in my DB.
a FOR loop is putting data from each row of the excel file into a class vars c,f,g..,m. and then calls this insert() func (for every row). here's a part of the code and line 207 is highlighted. how can I fix this error?
function insert() {
$sql = "INSERT INTO grades VALUES ( '".$this->c."','".
$this->f."','".$this->g."','".
$this->h."','".$this->i."','".
$this->j."','".$this->k."','".
$this->l."','".$this->m."' )";
$dblink = null;
try {
[B]$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);[/B]
mysql_select_db(DB_NAME,$dblink);
mysql_set_charset('utf8', $dblink) or die ('Error changing charset to hebrew');
} catch(Exception $ex) {
echo "Could not connect to " . DB_HOST . ":" . DB_NAME . "\n";
echo "Error: " . $ex->message;
exit;
}
$retid = mysql_query($sql,$dblink) or die(mysql_error());
if (!$retid) {
echo( mysql_error());
}
if(is_resource($dblink)) {
mysql_close($dblink);
}
return $retid;
}
I can PM the whole class code if that is necessary.
thank you