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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:49:53+00:00 2026-05-26T11:49:53+00:00

I have a model to fetch data from mysql database. I am using the

  • 0

I have a model to fetch data from mysql database. I am using the table and pagination library to display data. When displaying the data there is a column called “DELETE”, which is used for deleting each rows. Instead of using the text “DELETE” I want to use an image. I have tried a lot to add it in the model but it is not working. Would you please kindly help me?

Thanks in Advance 🙂

function batch_list()
{       
    $config['per_page'] = 15;
    $this->db->select('batchname, class, batchinstructor');
    $this->db->order_by("batchid", "desc"); 
    $rows = $this->db->get('batch',$config['per_page'],$this->uri->segment(3))->result_array();

    $sl = $this->uri->segment(3) + 1; // so that it begins from 1 not 0
    foreach ($rows as $count => $row)
        {
            array_unshift($rows[$count], $sl.'.');
             $sl = $sl + 1;

$rows[$count]['batchname'] = anchor('batch_list/get/'.$row['batchname'],$row['batchname']);
$rows[$count]['Edit'] = anchor('update_student/update/'.$row['batchname'],'Edit');
$rows[$count]['Delete'] = anchor('report/'.$row['batchname'],'<img src="base_url().support/images/icons /cross.png" alt="Delete" />"'); //<<< This is where I actually tried/want to add the image


            }
        return $rows;
    }
  • 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-26T11:49:54+00:00Added an answer on May 26, 2026 at 11:49 am

    Please clarify what you mean by not working.

    Anyway,
    for now I am guessing your problem is your escaping, try:

    anchor('report/'.$row['batchname'], '<img src="'.base_url().'support/images/icons/cross.png" alt="Delete" />');
    

    or if you are using the html helper you can use

    anchor('report/'.$row['batchname'], img('support/images/icons/cross.png'));
    

    (if you want the alt attribute you will need to use the array form)

    $img = array(
        'src' => 'support/images/icons/cross.png',
        'alt' => 'Delete'
    );
    
    anchor('report/'.$row['batchname'], img($img));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to display data from the database in a listview. I have fetch
I have to display data from the database in a listview. I have fetch
I am trying to fetch data from my database and when I display it
I currently have the below code to fetch data from my Entity framework model.
I have problems when i try to fetch data to my Backbone model from
I have a model that requires loading external data from an auxiliary source. A
when were i fetch a data from model it displays the all data from
I've got a model Employee which belongsTo an Address-model. When I fetch data from
I have a model being populated by my data layer and then I have
I have some model objects I'm using in my Java client application. Later these

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.