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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:19:57+00:00 2026-06-03T03:19:57+00:00

I have two columns, Entry and text_image , in a table. When looping to

  • 0

I have two columns, Entry and text_image, in a table. When looping to see all the rows in an array, I can get the results, but I want it to add /images to the rows that have text starting with img. This is to direct the rows that have “img” (meaning the text within the row) to the correct folder. It might need further explanation to illustrate why but I wont get into it.

while($row = mysql_fetch_array( $result3 )) {
    echo "<div class=\'entry\'>";
    (I want to add an echo "/images" before the rows that start with "img")

    echo $row[\'text_image\'];
    echo "</div>";
}

Thank you in advance

  • 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-03T03:20:01+00:00Added an answer on June 3, 2026 at 3:20 am
    $images = (substr($row['text_image'], 0, 3) == 'img') ? "/images" : "";
    echo $images . $row['text_image'];
    

    This will check if the first 3 letters of $row['text_image'] are img then set $images to /images else it will leave it empty. This will update each time within the loop.

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

Sidebar

Related Questions

I have two columns in my table and the rows are created dynamically. <table
One of the columns in my table is DataSource. Datasource can have two values,
I have two columns in a table: VisitorID, and URL. An entry exists in
I have two columns that are joined together on certain criteria, but I would
I have two columns(column1, column2) in my oracle database table named as demo .
I have two columns in a table that are populated with integer values. For
I have table with two columns (startdate & enddate) and I have two submission
I have Two tables like this: Table categories: columns: id, name, parent 1, Foods,
Ok say I have a table with two columns. Entry_id and name. Entry_id is
I have a table that holds only two columns - a ListID and PersonID.

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.