Subfader: Variable Anzahl an identischen Inserts aus Formular heraus

Beitrag lesen

Ich weiß wie es generell funktionert {Values (1,2), (3,4), (5, 6)] so ist nicht :)

Ich habe aber ein Formular mit einem kleinen Inputfeld in dem man die Anzahl eingeben kann, wie oft der gleiche Eintrag vorgenommen werden soll.

Formular (Auszug da ohne Anzahl funktioniert):
...Input für title, content
<input type="text" name="times" rows="1" size="2"> Input für Anzahl
...Submit

Action:
if ($_POST['times'] == NULL)
   {$times = array_keys(1)} else {$times = array_keys($_POST['times'])
$sql = "INSERT INTO table ( title, content) VALUES
foreach ($times) {
  ("".$_POST['title']."", "".$_POST['content']."")
  }
";

Wenn "times" 0 ist soll der Eintrag nur 1 mal erfolgen. Das "array_keys" ist sicher völlig falsch, hab ich woanders kopiert.

Für Hilfe wäre ich dankbar.

Gruß