Jump to content

PHP arrays


headmine

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.