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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:52:28+00:00 2026-05-30T16:52:28+00:00

I am trying to display objects for a reminders list with the following fields:

  • 0

I am trying to display objects for a reminders list with the following fields:
Title
Date Added
and a reminder image (a clock in my case)

Currently i display the object with the following code

    class ReminderList{

private $data;

/* The constructor */
public function __construct($par){
    if(is_array($par))
        $this->data = $par;
}


public function __toString(){

    $image = $this->data['image'];

    // The string we return is outputted by the echo statement
    return '
        <li id="todo-'.$this->data['id'].'" class="todo">

            <div>echo'<img src="'$image'">';</div>
            <div class="title">'.$this->data['title'].'</div>
            <div class="date">'.$this->data['date_time'].'</div>

            <div class="actions">
                <a href="#" class="editReminder">Edit</a>
                <a href="#" class="deleteReminder">Delete</a>
            </div>

        </li>';
}
   }

The fileds in the DB are

title
image (containing a path to the image, not a blob)
and date_time

When creating the object i have it writing the title, creating the time, and then input a path (images/reminder.png).

I get a Parse error: syntax error, unexpected T_STRING but thats from the way Im declaring the $image variable.

Any thoughts on the correct way to call an image path from a DB and plug it into an img src in php?

My apologies if this is unclear, ive been working with this problem a while

  • 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-30T16:52:29+00:00Added an answer on May 30, 2026 at 4:52 pm

    This line is definitely causing the parse error:

     <div>echo'<img src="'$image'">';</div>
    

    Change it to this:

    <div><img src="'.$image.'"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Telerik's RadPanelBar to display a list of objects. I
I'm trying to display a list of all the Input Methods that are currently
I am trying to display my command objects collection field inside a list box.
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
I am trying to display a list of all files found in the selected
I'm trying to display an array of files in order of date (last modified).
Here's something I'm trying to figure out concerning display objects in ActionScript3 / Flex.
I have been trying to display a list that I build using PySide. It
I'm trying to display a objects in my model in the form of a
I am having some problems trying to display child objects using itemtpl property for

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.