If I have the following sql statement, but my array index only goes up to 14, how do i check if index 15 is an Uninitialized array index. This is what I have so far, but still gives me the same error:
for($n = 0;$n < 17; $n++){
if($newArray[$n] == ""
{
$newArray[$n] = 0;
}
}
$sql = "UPDATE ".$project_id." SET
first_name = '".str_replace("'", "''", TRIM($newArray[0]))."',
last_name = '".CheckQuote( TRIM($newArray[1]) )."',
internet_address = '".TRIM($newArray[2])."',
address1 = '".TRIM($newArray[3])."',
address2= '".TRIM($newArray[8])."',
city= '".TRIM($newArray[4])."',
state= '".$newArray[5]."',
zip= '".$zip."',
phone= '".$newArray[17]."',
organization= '".$newArray[11]."',
org_code2= '".$newArray[12]."',
org_code3= '".$newArray[13]."',
org_code4= '".$newArray[14]."',
org_code5= '".$newArray[15]."',
org_code6= '".$newArray[16]."'
WHERE ID_NUMBER = '".$prospect_id."'";
Thanks!!
for($n = 0;$n < 17; $n++){
if($newArray[$n] == ""
$newArray[$n] = 0;
}
}
$sql = "UPDATE ".$project_id." SET
first_name = '".str_replace("'", "''", TRIM($newArray[0]))."',
last_name = '".CheckQuote( TRIM($newArray[1]) )."',
internet_address = '".TRIM($newArray[2])."',
address1 = '".TRIM($newArray[3])."',
address2= '".TRIM($newArray[8])."',
city= '".TRIM($newArray[4])."',
state= '".$newArray[5]."',
zip= '".$zip."',
phone= '".$newArray[17]."',
organization= '".$newArray[11]."',
org_code2= '".$newArray[12]."',
org_code3= '".$newArray[13]."',
org_code4= '".$newArray[14]."',
org_code5= '".$newArray[15]."',
org_code6= '".$newArray[16]."'
WHERE ID_NUMBER = '".$prospect_id."'";
Thanks!!