Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If I have the following sql stateme

Status
Not open for further replies.

NateUNI

MIS
Jan 3, 2002
132
US
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] == &quot;&quot;){
$newArray[$n] = 0;
}
}


$sql = &quot;UPDATE &quot;.$project_id.&quot; SET
first_name = '&quot;.str_replace(&quot;'&quot;, &quot;''&quot;, TRIM($newArray[0])).&quot;',
last_name = '&quot;.CheckQuote( TRIM($newArray[1]) ).&quot;',
internet_address = '&quot;.TRIM($newArray[2]).&quot;',
address1 = '&quot;.TRIM($newArray[3]).&quot;',
address2= '&quot;.TRIM($newArray[8]).&quot;',
city= '&quot;.TRIM($newArray[4]).&quot;',
state= '&quot;.$newArray[5].&quot;',
zip= '&quot;.$zip.&quot;',
phone= '&quot;.$newArray[17].&quot;',
organization= '&quot;.$newArray[11].&quot;',
org_code2= '&quot;.$newArray[12].&quot;',
org_code3= '&quot;.$newArray[13].&quot;',
org_code4= '&quot;.$newArray[14].&quot;',
org_code5= '&quot;.$newArray[15].&quot;',
org_code6= '&quot;.$newArray[16].&quot;'
WHERE ID_NUMBER = '&quot;.$prospect_id.&quot;'&quot;;


Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top