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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:10:55+00:00 2026-05-29T21:10:55+00:00

Here i have written a small code…in this looping is not done..only first image

  • 0

Here i have written a small code…in this looping is not done..only first image is displaying..Actually there are 7 images…Please help me on this

 <?php

$username = "root";
$password = "root";
$host = "localhost";
$database = "test";
error_reporting(E_ERROR | E_PARSE);
mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());

mysql_select_db($database) or die("Can not select the database: ".mysql_error());


header('Content-type: image/jpg');

$query = mysql_query("SELECT * FROM tbl_images");
while($row = mysql_fetch_array($query))
{
echo $content = $row['image']."</br>";
echo $content;
}
?>
  • 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-29T21:10:56+00:00Added an answer on May 29, 2026 at 9:10 pm

    try this:

    <?php
    
    error_reporting(E_ERROR | E_PARSE);
    
    $username = "root";
    $password = "root";
    $host = "localhost";
    $database = "test";
    
    mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
    
    mysql_select_db($database) or die("Can not select the database: ".mysql_error());
    
    //header('Content-type: image/jpg');
    
    $query = mysql_query("SELECT * FROM tbl_images");
    
    while($row = mysql_fetch_array($query)){
        echo '<img src="'.$row['image'].'" width=40 height=40>';// remove width and height later
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have written a small piece of code. This code first blocks the {SIGSEGV},
Here's a snippet of code from a shell script I have written: for src
Hi all i have written a small code to open a particular text file.
I have written some code in which a small part of the code takes
Just wondering what little scripts/programs people here have written that helps one with his
Here is my situation. I have written a WCF service which calls into one
I have in here an old web application written in ASP.Net 2.0 + AJAX.
Here's the thing: I have two applications, written in C++ and running on two
The system I work on here was written before .net 2.0 and didn't have
Here's my question. Right now I have a Linux server application (written using C++

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.