You previously gave this example as the command line which will call up the PHP script.
word[0]=this&number[0]=1&word[1]=sucks&number[1]=2
In this case, then, $word[2] is not defined at all, and so when $digit reaches 2, you'll get an error.
Would this do what you want?
$digit = 0;
while (isset($word[$digit])) {
.... do the mysql bit ...
$digit++;
}
This will go through the $word values one at a time until it finds one that's not defined, rather than checking for a blank value like your example does.