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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:47:16+00:00 2026-05-23T20:47:16+00:00

In short, my application needs to pull images from a MySQL db. Since the

  • 0

In short, my application needs to pull images from a MySQL db. Since the images pulled will depend on the users location I can’t just hardcode image file paths.

So far I’ve tried using just a PHP script that should allow the app to pull the images from the table into my db but I haven’t had any successful results.

In my app this is what I’m using to pull and decode the stream into a bitmap that the phone/app can use:

public static void createIcons(Resources res) throws IOException {
    String url1 = " http://mysite.iscool/file-get.php ";
    URL ulrn = new URL(url1);
    HttpURLConnection con = (HttpURLConnection)ulrn.openConnection();
    InputStream is = con.getInputStream();
   //end of lines added 

    markIcon=BitmapFactory.decodeStream(is);

Since I can’t seem to return an image to the device from the db using this so far I was wondering what sort of direction I should be going in. I’ve seen lots of different methods on here explained but I’m not too sure if the method I’m trying to use is even going to work for the purpose I need it to.

Also, I have seen mention of a REST service and other ways to extract images from a mysql db table. So does any one have an suggestions/tutorials/examples of extracting multiple images from a MySQL database?

By the way here is the code I’m using to try to return an image to the device:

<?php
 //----------------------------------------------------------
//
//---------------------------------------------------------
// access server
//---------------------------------------------------------
include("fLADB.php");
//
$dbQuery = "SELECT File FROM mark_image_store where imageid =(SELECT MAX(imageid) from
 mark_image_store);";

//-----------------------------------------------------------
// selecting into a single element variable
// stores only the first field which is the file data
//-----------------------------------------------------------
$result = mysql_query($dbQuery) or die(mysql_error());
//-----------------------------------------------------------
//reserved for when there is file ext data available.
//to format http headers
//Do not need for use by the phone.
//header("Content-type: image/jpeg");
//if ($ext = "png")
//-------------------------------------------------------------
// use imagejpeg, imagepng?
//-------------------------------------------------------------
header("Content-type: image/png");
print mysql_result($result, 0);
mysql_close();
?>

So after looking at my PHP and Android code can someone please give me some advice on which direction I should be going in next. Should I rework my Android side code and go with a REST service or Webservice or is a PHP script server side enough to handle the image returns.

Any advice/tutorials/or examples would be much appreciated thanks.

  • 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-23T20:47:16+00:00Added an answer on May 23, 2026 at 8:47 pm

    You can extract multiple images easily with a single query. But you’ll only be able to TRANSFER one image a time, unless you use some kinda of encapsulation like .zip.

    If you’re serving up the images via HTTP, you’ll definitely only be able to serve one picture at a time. There’s some tricks where you can serve up a single image with a series of smaller images tiled within it, and display them in restricted-sized divs as tiles/sprites, but that’d require client intervention.

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

Sidebar

Related Questions

I'm working on my first Django application. In short, what it needs to do
In short: I want to monitor selected calls from an application to a DLL.
I'm developing a web application that needs to interface with a MySQL database, and
Long story short, I have a substantial Python application that, among other things, does
I am writing an application to manage user access to files. The short version
Short: how does modelbinding pass objects from view to controller? Long: First, based on
In short: how to put a zipful of csv data into mysql? Long: I
My Node.js application accepts connections from the outside. Each connection handler reads a SET
I've got an application that's using string.compare(string,string) to sort some values. The thing I
Short version: I want to trigger the Form_Load() event without making the form visible.

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.