I want to simplify the following code. First I am reading in 6 values that
do not change.

Then I have 8 shifting values which are to be read in up to ten times. The
value of $inx02 tells me how many times to read in these 8 values. Each time
I read in the group of 8 values I need to increase $fx by 1 and read in the
group again until $fx is equal to $inx02. The actual database has 14 fields.
The first six values are repeated for every group of eight.

What I need is some help in simplyfying the rest of this code so I can add 1
to $fx and lopp until my requirement is met. Do I have to connect to the
database once for each entry of 14 fields or is there a way of storing
values and connecting once to write everything. The maximum total of entries
this can write in is 140. (ie 14
times the value of $inx02).

This is the code so far...



$fx = 1;

mysql_connect("localhost", "myusername", "mypassword") or
mysql_select_db("my_database") or die(mysql_error());
mysql_query("INSERT INTO `animals` VALUES ('$inx01', '$inx02', '$inx03',
'$inx04', '$inx05', '$inx06', '$iny01', '$iny02', '$iny03', '$iny04',
'$iny05', '$iny06', '$iny07', '$iny08', )");
Header("Location: http://www.mydomain.com/");


The output to the database could be something like

a, b, c, d, e, f, z, x, y, w, v, u, t, s
a, b, c, d, e, f, o, z, g, h, i, m, v, w
a, b, c, d, e, f, h, i, m, v, w, u, t, s
a, b, c, d, e, f, z, x, y, w, v, u, t, s

ie four entries with the first six fields in each entry identical.

Any help greatly appreciated.

Garry Jones