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 6986149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:46:19+00:00 2026-05-27T18:46:19+00:00

I have got a query in my model public function get_array() { $query =

  • 0

I have got a query in my model

public function get_array()
    {
        $query = $this->db->get($this->table);

        if ($query->num_rows() > 0)
        {
            return $query->result_array();
        }
        else
        {
            return FALSE;
        }  
    } 

Controller :

public function index()
{
    if ( ! $this->session->userdata('logged_in'))
    {
        redirect('login');
    }
    else
    {
        $data = array();

        $data['title'] = 'Text_about';

        $data['new_messages_number'] = count($this->about_text_model->new_messages());

        $data['new_messages'] = $this->about_text_model->new_messages();

        $data['about_text_list'] = $this->about_text_model->get_array();

        $ret = array();

        foreach ($data['about_text_list'] as $items)
        {
            $items['about_text_list']['text'] = word_limiter(strip_tags($items['text']), 100);
            $ret[] = $items;
        }

        $data['new_data'] = $ret;

        $name = 'about_text_show';

        $this->display_lib->admin_page($name, $data);               
    }              
}

view :

<? foreach ($new_data as $line) : ?>
                        <tr>
                            <td class="center"><?=$line['language']?></td>
                            <td><?=$line['header']?></td>
                            <td><?=$line['text'];?></td>

                            <td class="center"><?=$line['num']?></td>
                            <td class="center">
                                <a href="<?=base_url().$this->lang->lang();?>/about_text_edit/<?=$line['id']?>"><img src="<?=base_url();?>images/icons/icon_edit.png" alt="" title=""/></a>
                                <a href="?show=about_text&action=delete&id=<?=$line['id']?>"><img src="<?=base_url();?>images/icons/icon_missing.png" alt="" title="" /></a>
                            </td>
                        </tr>
                        <? endforeach; ?>

Problem is that I get data from SQL and write it to array with all html tags. I need clear text from html and make it shorter. Making array I do it with foreach and rewrite every field to new array (one field “text” I do strip_tags) after I display new array in my view.

I am surprised that my new making array display data without any error and no changes !
so where is thise line :

$items['about_text_list']['text'] = word_limiter(strip_tags($items['text']), 100);
  • 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-27T18:46:20+00:00Added an answer on May 27, 2026 at 6:46 pm

    Assuming your code it should be

    $line['about_text_list']['text']
    

    not just

    <td><?=$line['text'];?></td>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a temporary table using cakephp $this->Model->query() and inserted some records using
Got a problem with a query I'm trying to write. I have a table
I have a CI Model set up with this function and ActiveRecord: function get_open_competitions()
I have this code in my model when the controller requests to get all
i've got a SQL query which returns multiple rows, and i have : $data
I have the following code and got myself confused: I have a query that
I have got a C function in a static library, let's call it A,
I have got some code to load an assembly and get all types, which
I've got a query that looks like this affiliates = User.objects.annotate(referral_count=Count('referrals')) .filter(referral_count__gt=0) But when
I got a problem with Entity Framework 4.0 I have a hierarchical table Category:

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.