I am trying to insert a very large amount of data into a MySQL database using this basic code:
$query = "INSERT INTO PublicNoticesTable (url, county, paperco, date, notice, id) VALUES " . $queryString;
$result = mysqli_query($connect, $query);
The $queryString
is generated beforehand and contains thousands of lines of information in the format of:
('a', 'b', 'c'),('a', 'b', 'c');
That way I can insert multiple rows of data in one mysql call and to reduce the processing time. I have the ability to throttle the amount of information that goes into $queryString
and when I have a smaller amount of information the query succeeds. YAY! When I put a little bit too much information the query fails. If anyone could provide a solution for me it would be greatly appreciated. I am using GoDaddy and PHPMyAdmin, if that's important.
Thank you!