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

The Archive Base Latest Questions

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

I am trying to pull a picture from my server (which has pictures stored

  • 0

I am trying to pull a picture from my server (which has pictures stored in a mysql db). I am not getting a picture back correctly when I attempt to get to call it however? Here is how I attempt to set up the php server response…

if(mysql_query("insert into Personal_Photos (Email, Pics) values('$email', '$data')"))
            {
                $query="select Pics, MAX(ID) from Personal_Photos where Email='$email'";
                $result=mysql_query($query) or die("Error: ".mysql_error());
                $row=mysql_fetch_array($result);
                //$mime = 'image/yourtype';
                //$base64 = base64_encode($contents);
                //$uri = "data:$mime;base64,$base64";
                header("Content-type: image/jpg");
                print($row['Pics']);
            }

Here is the jquery Form call that attempts to get this picture…

$('#profilepicbutton').live('change', function(){
    $("#preview").html('');
    $("#preview").html('<img src="loader.gif" alt="Uploading...."/>');
        $("#registerpt3").ajaxForm({
                target: '#preview',
                success: function(data)
                {                                   
                    $("#preview").html('');
                    $("#preview").append("<img src="+data+"></img>");
                }
            }).submit();
 });

UPDATE: GETTING WEIRD RESULT
Getting a weird result when I change my php code to this

    if(mysql_query("insert into Personal_Photos (Email, Pics) values('$email', '$data')"))
            {
                $query="select Pics, MAX(ID) from Personal_Photos where Email='$email'";
                $result=mysql_query($query) or die("Error: ".mysql_error());
                $row=mysql_fetch_array($result);
                //$mime = 'image/yourtype';
                //$base64 = base64_encode($contents);
                //$uri = "data:$mime;base64,$base64";
                //header("Content-type: image/jpg");
                echo '<img src="data:image/jpeg;base64'.base64_encode($row['Pics']).'"/>';
            }
  • 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-25T23:57:20+00:00Added an answer on May 25, 2026 at 11:57 pm

    An image must be loaded from a url using a “GET” request. (Ok, not always – you can use data urls, but it can be buggy and browser support is an issue). So, if you can get your php page using a “GET” request rather than “POST”, this is no problem. Use .serialize() to create your querystring, and assign the url to your image’s src:

    $('#profilepicbutton').live('change', function() {
        $("#preview").html('');
        $("#preview").html('<img src="loader.gif" alt="Uploading...."/>');
        var form = $("#registerpt3");
        var page = form.attr("action");
        var qs = form.serialize();
        var url = page + "?" + qs;
        $("<img>").load(function() {
            $("#preview").empty().append(this);
        }).attr("src", url);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pull in data from a remote SQL Server. I can access
Trying to pull the text from a label on the page but it's not
I am trying to pull some data from a server (I don't own the
Basically I'm trying to pull a random poll question that a user has not
I'm trying to pull some html data from a mysql database to populate a
I'm trying to pull two values from this Dictionary, But the values I'm getting
im trying to pull .swf files from MySQL by using PHP, ive set everything
I am trying to pull 1 week data from sql server, then trying to
Just trying to pull off some SMART info from connected Hard Drives on any
I'm trying to pull data using a SqlDataReader, one column of which is in

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.