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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:10:15+00:00 2026-05-28T15:10:15+00:00

I am using this code to display image from URL, but it is not

  • 0

I am using this code to display image from URL, but it is not working,

<?php
     echo 'me'.'<br/>';


      $sql= 'SELECT url_imgsrch FROM p_url_imgsrch';
      $result   =   mysql_query($sql);
        echo $result;
       $row = mysql_fetch_row($result);


      for ($i=0; $i<6; $i++){

        //calling rows
        echo '<td>';

//calling rows value for debugging purpose so that i can learn the process and check the output

         echo $row[$i].'<br/>';

echo '<img name="myimage" src="<?php echo $row[$i]; ?>" width="60" height="60" alt="word" />';

            echo '</td>';
            }

     ?>

The result is, I get alt text only, and image is not displayed. also, I get error

Notice: Undefined offset: 1 in D:\wamp\www\demo\login\flashcard.php on
line 31

In my file
What I am trying is, to get 5 img url from database and display them in columns of a table..and what I guess is I am getting same img URL again and again…for 5 times..

Please give me guideline and tell me what I could be missing…

  • 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-28T15:10:17+00:00Added an answer on May 28, 2026 at 3:10 pm

    i have never seen someone loop through a query that way, i do it like this:

    print "<table>";
    $sql= 'SELECT url_imgsrch FROM p_url_imgsrch LIMIT 5';
    $result   =   mysql_query($sql);
     while($row = mysql_fetch_array($result)){
        print '<tr>
                <td>
                   <img name="myimage" src="'.$row[column_name_here].'" width="60" height="60" alt="word" />
                </td>
              </tr>';
        }
    print "</table>";
    

    change column_name_here to the name of the column which store the image file name

    edit: changed mysql_fetch_row to mysql_fetch_array <- that is why u got the same image all 5 times.

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

Sidebar

Related Questions

Ii'm using this NSURL code to display an image. what I want to do
I'm using this code to display severl images from the internet ImageView iv =
I have this code here, but it's not working I just get No Process
I am using this code to display a grid $('#table1 tr').bind('click', shows); function shows()
I am using this code in wordpress to display different content when different pages
Why does this code fail to display the category name Apples using the current
When using this code (simplified for asking): var rows1 = (from t1 in db.TABLE1
I'm using this code, to make a request to a given URL: private static
I am using WAMP. I want to take background image URL from my database
Using the following code to display a list of friends from my twitter profile.

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.