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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:57:08+00:00 2026-05-19T04:57:08+00:00

I am building a picture gallery, that uses this code to display each product

  • 0

I am building a picture gallery, that uses this code to display each product I have:

<div class="feature">
            <a href="#"><imagetag alt="Image Caption"srcs=""></a>
            <div>
                <p>
                    This is some information that can go along with an image.
                    Anything can be placed here, including images.
                </p>
            </div>
</div>

I need to create a while loop, that takes all the products in my database, and creates a div of the “feature” class for every instance. I have problems know exactly which symbols need to be escaped and etc. Your help is greatly appreciated.

here is my start:

   <?php
 ($product_set = mysql_fetch_assoc($query)) {
  print("<div class="feature"> <a href="#"><imagetage alt="Image Caption" srcs=$product_set[products_image]></a>"


    );}
   ?>
  • 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-19T04:57:09+00:00Added an answer on May 19, 2026 at 4:57 am

    If you are in a string, every doublequote should be escaped. Because it will close your string.

    <?php
        ($product_set = mysql_fetch_assoc($query)) 
        {
            print "<div class=\"feature\"><a href=\"#\"><img alt=\"Image Caption\" src=" . $product_set['products_image'] . "></a>";
        }
    ?>
    

    Fun thing is, I got a link from someone on stackOverflow about PHP templating. Which was using Smarty. So you don’t have to use these print states anymore.

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

Sidebar

Related Questions

Building an inventory system. I have lots of products and each product has three
I'm building a dialog that lets you click the picture multiple times, and each
I'm building an editor which uses a TImage to display a picture and has
I'm building a Zend_Form.Having: $file=new Zend_Form_Element_File('file'); $file->setDescription('upload a picture:') ->setDestination(myPath); $file->class=media[]; $file->setDecorators(array( 'File', array('Description',array('placement'=>'PREPEND','tag'=>'')),
i am building a workout website that tracks exercises. Each exercise has a mapping
I am building a program that randomly generates a number then this number is
Im building a website with a jquery header that fades one picture into the
I have been building a Motion Picture application to manage actors or Talents. I
I am building an app that starts when a user takes a picture using
I am building a chess game and i have a loop that runs through

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.