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

  • Home
  • SEARCH
  • 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 8858267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:47:22+00:00 2026-06-14T14:47:22+00:00

I have following code for get image from my database table field. public function

  • 0

I have following code for get image from my database table field.

public function getStudentses() {
    $students_data = array();       

    $query = $this->db->query(
        "SELECT * FROM " . DB_PREFIX . "students 
        WHERE customer_id = '" . (int)$this->customer->getId() . "'");   

    foreach ($query->rows as $result) {             
        $students_data[$result['students_id']] = array(
            'students_id'        => $result['students_id'],
            'firstname'          => $result['firstname'],
            'filename'           => $result['filename'],
            'image'              => $result['image'],
        );
    }       
    return $students_data;
}

This is my HTML code for display image:

<img src="<?php echo $result['image']; ?>" />

but when I render my page the image is not display properly its like some symbols like

s4�.���N����萗�p�A@4pbr��]�����F�G�>�v��W

Why its like this? How can I fix my error?

  • 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-06-14T14:47:23+00:00Added an answer on June 14, 2026 at 2:47 pm

    Modern browsers have this support for using raw image data as source.

    You can try to use something like:

    <img src="data:image/png;<?php echo $result['image']; ?>" />
    

    You should encode the image using base64 and then output something like:

    <img src="data:image/png;base64,<?php echo base64_encode($result['image']); ?>" />
    

    I have use image/png for example. If your image is something else, you should use corresponding encType.

    Just make sure to read this and this.

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

Sidebar

Related Questions

I have the following code: // GET: /PlayRoundHole/Create public ActionResult Create(int id) { DB
I am using the following code to get data from the database( from cs
I'm using the following code to get the image filenames from an HTML file.
I am using the following code to bind an image from my database (compact
I done delete image url from database with following code, but is not delete
I have the following code to get the object type of a collection: Dim
i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor
I have the following code to get details of a contact. data: is the
I have following code that does not work: I never get to goToFoodDetail .
I have a following simple code: def get(): return [lambda: i for i in

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.