Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6121995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:50:52+00:00 2026-05-23T15:50:52+00:00

<?PHP // areaList // [0] = Upstairs Tables // [1] = Upstairs Seats //

  • 0
<?PHP
    // areaList
    //  [0] = Upstairs Tables
    //  [1] = Upstairs Seats
    //  [2] = Upstairs TV
    //  [3] = Upstairs Computers
    //  [4] = Lounges SL
    //  [5] = Lounges BL
    //  [6] = Conference Room 216
    //  [7] = Conference Room 218
    //  [8] = Conference Room 219
    //  [9] = Conference Room 220
    // [10] = Cash 204
    // [11] = Cash 205
    // [12] = Cash 207
    // [13] = Downstairs Lobby
    // [14] = Downstairs Center
    // [15] = Downstairs Rec
    // [16] = Downstairs Computers
    // [17] = Games Bowling
    // [18] = Games Billiards
    // [19] = Games Arcade
    // [20] = Plaza  1
    // [21] = Plaza  2
    // [22] = Plaza  3
    // [23] = Plaza  4
    // [24] = Plaza  5
    // [25] = Plaza  6
    // [26] = Plaza Res

$areaList = 
    array (1=>
        "<b>Upstairs Tables", "<b>Upstairs Seats", "<b>Upstairs TV", "<b>Upstairs Computers", 
        "<b>Lounges SL", "<b>Lounges BL", "<b>Conference</b><br />Room 216", "<b>Conference</b><br />Room 218",
        "<b>Conference</b><br />Room 219", "<b>Conference</b><br />Room 220", "<b>Cash 204" , "<b>Cash 205", 
        "<b>Cash 207", "Downstairs Lobby", "<b>Downstairs Center", "<b>Downstairs Rec", 
        "<b>Downstairs Computers", "<b>Games  Bowling", "<b>Games  Billiards", "<b>Games  Arcade",
        "<b>Plaza 1", "<b>Plaza 2", "<b>Plaza 3", "<b>Plaza 4", "<b>Plaza 5", 
        "<b>Plaza 6", "<b>Plaza Res" 

    );  
    //array_unshift($areaList, "");
    //unset($areaList[0]);  
?>

<div id="add_content">                          
    <table class="listing" width="100%">
        <tr>
            <th width="25%">Area</th>
            <th width="5%">Count</th>
            <th width="40%">Comment</th>
            <th width="10%"></th>
        </tr>

        <?PHP
        $odd = 1;
        for ( $i = 1 ; $i < count($areaList) ; $i++ )
        {
            $odd=$odd+1;?>
           <form name="add" action="/directory/filename/" method="post" enctype="multipart/form-data">
            <tr <?PHP if($odd%2==1) echo "class=\"odd\"" ?>>
            <td style="text-align:center;">
            <?php echo $areaList[$i]; ?>
            <input type="hidden" name="data[TableName][area]" value="<?PHP echo $i;?>" />
            </td>
            <td>
            <?PHP 
            foreach ($upc as $uvalue) //$upc is an array from sql statement in Model.."SELECT area FROM table_name WHERE table_reports_id = ".$id." ORDER by area ASC"
            // there are 27 areas and it is displaying 27 counts for each Area instead of 1 count per area. I need to tell it to only grab the count for this area based on $i.
            {
                echo $html->input('Table/count'.$i, array('class'=>'inputbox','size'=>'3', 'value'=> $uvalue['table_name']['count'] ));

            } ?>
            </td> 
            <td width="25%"style="text-align:center;">
            <?php echo $html->input('Table/comments'.$i, array('size' => '50'), array('maxlength' => '60'));?></td>
            <td class="tdsubmitbutton" colspan="4" style="text-align:right">
            <?php echo $html->submit('Submit') ?></td>
            </tr>

         </form>
        <?PHP unset ($uvalue); }
            ?>
    </table>
    </div>
    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:50:52+00:00Added an answer on May 23, 2026 at 3:50 pm

    You need to somehow build that array so you know what value is at what index and then print out the value like $upc[$i]

    Also if that is your real sql statement you should always enclose parameters with ” and make sure to escape all input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP functions such as 'array_map' take a callback, which can be a simple function
PHP version 5.3 has been released, and although it looks great, all my code
PHP uses magic quotes by default but has gotten a lot of flak for
PHP/MySQLisolating database access in class - how to handle multiple row Selects Here’s a
PHP: $a = 0; $b = 00; var_dump(empty($a)); # True (wtf?) var_dump($a == $b);
PHP code: <a id=a$id onclick=check($id,1) href=javascript:void(0) class=black>Qualify</a> I want to remove the onclick=check($id,1) so
PHP 5.3 has been released some time ago and the developers tried to keep
PHP file.php arg1 arg2 Now I want to hardcode arg1 and arg2 into file.php
php -v gives this PHP Warning: PHP Startup: memcache: Unable to initialize module Module
php file.php & How to get PID of the background process in file.php ?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.