I'm new to Codeignitor. My senior had previously used the following code to retrieve an array from a database. It retrieves all of the items in the database, but I only want the first one, Please Help:
<?php $custom_fields = get_custom_fields('projects');
if(count($custom_fields) > 0){ ?>
<?php foreach($custom_fields as $field){ ?>
<?php $value = get_custom_field_value($project->id,$field['id'],'projects');
if($value == ''){continue;} ?>
<tr>
<td class="bold"><?php echo ucfirst($field['name']); ?></td>
<td><?php echo $value; ?></td>
</tr>
<?php } ?>
<?php } ?> ```
**I attempted to retrieve the data using index key [1], but I failed miserably.**
``<?php $custom_fields = get_custom_fields('projects');
if(count($custom_fields) > 0){ ?>
<?php foreach($custom_fields as $field){ ?>
<?php $value = get_custom_field_value($project->id,$field['id'],'projects');
if($value == ''){continue;} ?>
<tr>
<td class="bold"><?php echo ucfirst($field[0 &&'name']); ?></td>
<td><?php echo $value[0]; ?></td>
</tr>
<?php } ?>
<?php } ?> ```
I tried using index key [0] but i got miserably failed.