headmine Posted April 9, 2009 Share Posted April 9, 2009 I am sorta new to php. I know how to do this in asp. I don't get any errors when I do this but nothing outputs. Basically I want it to look at the values being pulled from the database. If there is no data in the field I would like it to print out. "N/A" Here is what I have. $myFixedArray[0] = $row_rs_letter['bq1']; $myFixedArray[1] = $row_rs_letter['bq2']; $myFixedArray[2] = $row_rs_letter['bq3']; $myFixedArray[3] = $row_rs_letter['bq4']; $myFixedArray[4] = $row_rs_letter['ny']; $myFixedArray[5] = $row_rs_letter['bq8']; $myFixedArray[6] = $row_rs_letter['bq9']; $myFixedArray[7] = $row_rs_letter['Q3367']; $myFixedArray[8] = $row_rs_letter['Q3363']; $myFixedArray[9] = $row_rs_letter['Q3362']; $whois = $_GET['ID']; foreach($myFixedArray as $key => $value) { if ($myFixedArray == "") { echo ("N/A"); } } Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/153380-php-arrays/ Share on other sites More sharing options...
taquitosensei Posted April 9, 2009 Share Posted April 9, 2009 not sure what you're trying to accomplish here. But if you're trying to checke each value something more like this $myFixedArray[0] = $row_rs_letter['bq1']; $myFixedArray[1] = $row_rs_letter['bq2']; $myFixedArray[2] = $row_rs_letter['bq3']; $myFixedArray[3] = $row_rs_letter['bq4']; $myFixedArray[4] = $row_rs_letter['ny']; $myFixedArray[5] = $row_rs_letter['bq8']; $myFixedArray[6] = $row_rs_letter['bq9']; $myFixedArray[7] = $row_rs_letter['Q3367']; $myFixedArray[8] = $row_rs_letter['Q3363']; $myFixedArray[9] = $row_rs_letter['Q3362']; $whois = $_GET['ID']; foreach($myFixedArray as $key => $value) { if ($value == "") { echo ("N/A"); } } Link to comment https://forums.phpfreaks.com/topic/153380-php-arrays/#findComment-805814 Share on other sites More sharing options...
headmine Posted April 9, 2009 Author Share Posted April 9, 2009 Wow... One little word... I guess that's part of programming fun... Thanks soo much! Link to comment https://forums.phpfreaks.com/topic/153380-php-arrays/#findComment-805821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.