// CHECK FOR TOTAL INPUTS... $vbulletin->input->clean_gpc('p', 'title', TYPE_FILE); $vbulletin->input->clean_gpc('p', 'description', TYPE_FILE); $totaltitles = count($vbulletin->GPC['title']['name']); // INSERT FORM $sqlvalues = 'VALUES'; $first = true; for($x = 1; $x <= $totaltitles; $x++) //something goes there or make it a while, foreach { $sqlvalues .= ($first ? '' : ', ') . " ('" . $db->escape_string($somevalue) . "', '" . $db->escape_string($somevalue2) . "') "; $first = false; } /* query insert */ $db->query_write(" INSERT INTO TABLE(value1, value2) $sqlvalues ");