I put together some code to process the values in an array. However, it appears that only the first line is being printed out. I can verify that the array has a size of 247 (by including a sizeof()
check before the loop).
Is there something I am not seeing here? The declaration of my $title
variable is :
$title = array();
on a global scope.
function pushTitleChanges()
{
global $title, $first_name, $last_name;
$index = 0;
print_r($title);
if(is_array($title))
{
for($x =0; $x< sizeof($title);$x++)
{
echo "The index is " . $index .' '. "and title size is " . sizeof($title);
echo "<br/>";
$title = str_replace(array('.', ','), '' , $title[$index]);
$statement = "UPDATE guest_list_guests
SET guest_list_guests.title = '{$title}'
WHERE guest_list_guests.first_name ='{$first_name[$index]}'
AND guest_list_guests.last_name = '{$last_name[$index]}';";
$index++;
}
}
}