Image from a URL database record

Hi
I am building an online catalog usual stuff product name, link, price, image etc
the product link and image are on another server url's are datatbade cells
no problem with the product link using <td><p><a href="<?php echo $row_Recordset1['productUrl']; ?>" target="_new"> click for more</a></p></td>
But I am having problem with the image have tried
<td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>
   <?php echo $row_Recordset1['description']; ?></td>
but just get an image placeholder box even when uploaded to server and previewed in browser
the whole details are
<table border="1">
  <tr>
    <td>name</td>
    <td>productUrl</td>
    <td>imageUrl</td>
    <td>description</td>
  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo $row_Recordset1['name']; ?></td>
      <td><p><a href="<?php echo $row_Recordset1['productUrl']; ?>" target="_new"> click for more</a></p></td>
      <td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>
   <?php echo $row_Recordset1['description']; ?></td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
Thank you

You have a href in your image src... I've never seen that before, so I wouldn't know if it's correct syntax.
Change:
<td><img src="<a href="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>
to:
<td><img src="<?php echo $row_Recordset1['imageUrl']; ?>" ></td>
and if you want the image to be clickable:
<td><a href="url-here" border="0"><img src="<?php echo $row_Recordset1['imageUrl']; ?>" ></a></td>

Similar Messages

  • [noob needs help] Loading image from a URL

    Hey everyone. I'm new here. And I'm new at J2ME as well.
    I have a simple school project and I have doubts about it. I've searched everywhere on the net yet I could not find the solution. Anyways, I do understand the concept of loading images by putting the files in the "res" folder and use:
    try
    img = Image.createImage("/burgerimgsmall.jpg");
    catch (Exception e)
    e.printStackTrace();
    But my project requires me to load an image from a URL. How do I go about doing that? If it helps, here's the URL:
    http://img.photobucket.com/albums/v703/punkgila/burgerimgsmall.jpg
    Thanks guys!

    Don't worry, downloading image from http is also simple. Look into Photoalbum demo in wtk2.5

  • I want to download an image from the url and image is in byte format

    hi
    i want to download an image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be the length of the image,we need to download except first 5 digits and display an image file
    i need to finish this today
    pla reply if any body knows solution for this.
    thanks in advance
    Mraj

    You do not need to do anything - iPhoto always keeps the original and you can revert to it at any time
    If you want to be able to see the original and the cropped version in iPhoto at the same time duplicate the photo (this does not really duplicate but simply starts a new edit stream for the photo - command-d) and crop the duplicate
    LN

  • Inserting an image from an URL in a BLOB

    Hello all,
    As it's said in the title, I need a PL/SQL procedure to insert a image from web URL in a BLOB table column.
    How can I do that?
    Thanks in advance for your help.
    Max

    found this on the internet http://www.oracle-base.com/articles/misc/RetrievingHTMLandBinariesIntoTablesOverHTTP.php
    CREATE TABLE http_blob_test (
      id    NUMBER(10),
      url   VARCHAR2(255),
      data  BLOB,
      CONSTRAINT http_blob_test_pk PRIMARY KEY (id)
    CREATE SEQUENCE http_blob_test_seq;
    CREATE OR REPLACE PROCEDURE load_binary_from_url (p_url  IN  VARCHAR2) AS
      l_http_request   UTL_HTTP.req;
      l_http_response  UTL_HTTP.resp;
      l_blob           BLOB;
      l_raw            RAW(32767);
    BEGIN
      -- Initialize the BLOB.
      DBMS_LOB.createtemporary(l_blob, FALSE);
      -- Make a HTTP request and get the response.
      l_http_request  := UTL_HTTP.begin_request(p_url);
      l_http_response := UTL_HTTP.get_response(l_http_request);
      -- Copy the response into the BLOB.
      BEGIN
        LOOP
          UTL_HTTP.read_raw(l_http_response, l_raw, 32767);
          DBMS_LOB.writeappend (l_blob, UTL_RAW.length(l_raw), l_raw);
        END LOOP;
      EXCEPTION
        WHEN UTL_HTTP.end_of_body THEN
          UTL_HTTP.end_response(l_http_response);
      END;
      -- Insert the data into the table.
      INSERT INTO http_blob_test (id, url, data)
      VALUES (http_blob_test_seq.NEXTVAL, p_url, l_blob);
      -- Relase the resources associated with the temporary LOB.
      DBMS_LOB.freetemporary(l_blob);
    EXCEPTION
      WHEN OTHERS THEN
        UTL_HTTP.end_response(l_http_response);
        DBMS_LOB.freetemporary(l_blob);
        RAISE;
    END load_binary_from_url;
    EXEC load_binary_from_url('http://forums.oracle.com/forums/themes/english/resources/oralogo_small.gif');

  • Multiple images from static URL

    I am currently writing an applet that grabs radar images from a static URL. The image on the URL is updated every 15 minutes. I have a timer that will grab the image every 15 minutes and put it in an image[] array. Eventually I will be looping these images, and let the user define how far back to loop and how fast the loop is. Right now, though, every image it grabs is the same as the very first one. For testing purposes I have the URL currently set to an online panda cam with a timestamp (so I dont have to wait 30 minutes every build to see if it works on the radar URL). If I start the program at 12:47:51(timestamp on webcam) , it grabs a new image every 10 seconds. After a few minutes I have an array of images with the timestamp 12:47:51, every image is identical.

    well, I have the url
    "url"
    and the image[] array
    "imageArray[x]"
    in the actionPerformed for the timer:
    imageArray[x] = getImage(url); Currently I just have a button to step thru the images.
                        backg.drawImage(imageArray[counter],0,0,radarWidth,radarHeight,Color.white,this);Just to see if that worked I loaded the array with images from different URLs, and I was able to display them all without problem. Just when I use the static URL do I get the problem of the repeated image.

  • Display images from a SQL database

    I want to display images from a SQL database. The images are in a table under a specific column and are stored as a link to the image. How would I display the images from the column in LabVIEW?
    I'm using LabVIEW 2013 version 13 and SQL Server 2012
    Paul Power
    I have not lost my mind, it's backed up on a disk somewhere

    Hi PauldePaor,
    I hope you are well.
    Once you have pulled the data from the database into LabVIEW in a string form (or path), you can simply use the Read BMP File (Or jpg, png depending on the file type) VI.
    More information can be found here:
    http://digital.ni.com/public.nsf/allkb/02971A30F5D8FC6986256A0A004F11A0
    Kind Regards,
    Aidan H
    Applications Engineer
    National Instruments UK & Ireland

  • Saving an Image from a url

    I need to write a simple(even dos based) app that saves an image from a url (ie http://www.google.com/images/logo.gif) into c:\temp\*filename*
    thanks alot for the help

    Its just like reading/writing a regular file. Check out the 'Custom Networking" tutorial found on this page:
    http://java.sun.com/docs/books/tutorial/

  • Display an image from a URL

    Hi,
    I've looked through the Java Swing tutorial and I've searched the forums here, but I haven't figured out how to load an image from a URL into my GUI and display it.
    I don't want the image to be at certain coordinates, as I am using the FlowLayout. My problem is: how do I load an image from a URL, then display it in a JPanel, such as a JScrollPane?
    I'm sorry if I missed any tutorials or similar things about this topic, but if anyone could provide some advice, I would appreciate it.
    Thanks,
    Dan

    try this:
              try {
                   JLabel label = new JLabel(new ImageIcon(new URL("http://developers.sun.com/forums/img/gold.gif")));
                   JScrollPane sp = new JScrollPane(label);
              catch (MalformedURLException x) {
                   x.printStackTrace();
              }

  • I need to download image from the url and the image is in byte format.

    hi
    i need to download image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be its length,we need to download except 5 digits.
    can any one know how to do that.
    thanks in advance
    Mraj

    hi
    i need to download image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be its length,we need to download except 5 digits.
    can any one know how to do that.
    thanks in advance
    Mraj

  • I want to download and image from the url and image is in byte format

    hi
    i want to download the image from the url:
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    can any one help me to do this i need to finish this today plz help me.
    first 5 character 09593 is the length of the image we need to substract image length from total length.
    thanks in advance
    M.Raj
    Edited by: Mraj.Bangalore on May 15, 2008 12:01 AM
    Edited by: Mraj.Bangalore on May 15, 2008 12:01 AM

    hi
    thanks for the reply,
    that works only if .png file is there in the path.
    i worked it out, it is working fine now
    try
                   httpConn = (HttpConnection)Connector.open(url);
                   is=httpConn.openInputStream();
                   responseCode = httpConn.getResponseCode();
                   if(httpConn.getResponseCode() == 200)
                             ByteArrayOutputStream bStrm = null;
                             byte[] data = new byte[512];
                             int contentLen = httpConn.getHeaderFieldInt("Content-Length", 0);
                             if(contentLen > 0)
                                  response = new byte[contentLen];
                             else
                                  bStrm = new ByteArrayOutputStream();
                             int count = 0, tmp =0;
                                  while ((count = is.read(data)) >= 0)
                                       if( contentLen > 0 )
                                            for(int i=0;i<count && tmp+i < contentLen;i++)
                                                 response[tmp+i] = data;
                                            tmp += count;
                                       else
                                            bStrm.write(data, 0, count);
    //                                    if( aborted)
    //                                         break;
                                  data = null;
                                  System.gc();
                                  if( contentLen <= 0 )
                                       response = bStrm.toByteArray();
                                       bStrm.close();
                                       bStrm = null;
                                       System.gc();                                   
                        else
    //                          main.showAlert("ERROR","Connection failed.Please access again later");
    //                          main.changeToMain();
              catch(Exception e){
                   response = null;
                   responseCode = 0;
    //                main.showAlert("ERROR","Connection failed.Please access again later");
    //                main.changeToMain();
              catch(OutOfMemoryError e){
    //                main.showAlert("ERROR","Not enough memory, please disable some apps or delete files and try again.");
    //                main.changeToMain();
              finally
                   System.out.println("Before Creation"+response.length);
                   img = Image.createImage(response, 5, response.length-5);
                   System.out.println("After Creation");
                   CanvasImageFile canvas = new CanvasImageFile(this);
                   midlet.display.setCurrent(canvas);
                   try
                        if( is != null )
                             is.close();
                             is=null;
                   catch(Exception ex){
    //                     main.showAlert("ERROR","Connection failed.Please access again later");}
                             if( httpConn != null )
                             try {
                                       httpConn.close();
                                  } catch (IOException e) {
                                       // TODO Auto-generated catch block
                                       e.printStackTrace();
                             httpConn=null;

  • How can I use wget, cron and Automator to periodically pull a dynamic image from a URL to local storage, and then update a Keynote slide with that image, automatically?

    How can I use wget, cron and Automator to periodically pull an image from a URL (which is dynamically updated - like a weather map, say - to local storage, and then update a Keynote slide with that image, automatically?

    Any particular reason for those specific technologies?  wget does not exist on a mac, although you can nstall it I guess.  OS X has curl installed which should do pretty much anything you want to do with wget.  cron is being replaced by launchd, although cron still exists on mountain lion.
    As far as I can tell from automator all the standard 'actions' to access keynote  available to it require keynote to be open and running, but does not provide a function to actually open it.  So I think you will have to write some applescript, as a minimum to open and quit keynote. I notice that the keynote actions are mostly circa 2005 an wonder if they would even work.
    Under utilities in automator 'actions' there is a capability to add applescripts as part of the workflow.
    Also, note that cron is being dprecated by Apple and replaced by launchd.  that said cron is stil on my mountain lion instalation.
    This entry at stackoverflow shows use of cron with curl to get web urls.  http://stackoverflow.com/questions/1683620/getting-started-with-cronjobs-on-a-ma c
    If I have any time I may try and get this to work as it is quite interesting and new to me.  But otherwise, good luck.

  • Getting image from Microsoft Access database to display in browser

    Hey! anybody please help me
    I've been trying with no success to get an image from a microsoft access database
    so far this is what i have:
    package Servlets;
    import java.io.*;
    import java.net.*;
    import utils.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class serv extends HttpServlet {
        java.sql.ResultSet rs=null;
        ClsConexion conexion=new ClsConexion("Nedermex");
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            conexion.conectate("1", "1");
            rs=conexion.obtenRegSelect("SELECT * FROM Flores WHERE ID=1");
            try{
                rs.next();
                System.out.println("sadfsadf " + rs.getString("ID"));
            }catch(Exception e){
                e.printStackTrace();
            String ubicGIF = request.getParameter("ubicGIF");
            if((ubicGIF==null) || ubicGIF.length() == 0 ){
                indicarError(response, "Archivo de imagen no establecido");
                return;
            //String archivo = getServletContext().getRealPath(ubicGIF);
            try{
                if(rs.next()){
                    System.out.println("sadfsadf " + rs.getString("ID"));
                    BufferedInputStream ingreso = new BufferedInputStream(rs.getBinaryStream("Imagen"));
                   // BufferedInputStream ingreso = new BufferedInputStream(new FileInputStream(getServletContext().getRealPath("1.jpg")));
                    ByteArrayOutputStream flujoBytes = new ByteArrayOutputStream(512);
                    int byteImagen;
                    while ((byteImagen= ingreso.read()) != -1){
                        flujoBytes.write(byteImagen);
                    ingreso.close();
                    String indiPersistencia = request.getParameter("usePersistence");
                    boolean usePersistence = ((indiPersistencia == null) || (!indiPersistencia.equals("no")));
                    response.setContentType("image/jpeg");
                    if(usePersistence){
                        response.setContentLength(flujoBytes.size());
                    flujoBytes.writeTo(response.getOutputStream());
            }catch(IOException ioe){
                indicarError(response, "Error: " + ioe);
            }catch(java.sql.SQLException sqle){
                indicarError(response, "Error: " + sqle);
        public void indicarError(HttpServletResponse response, String mensaje) throws IOException {
            response.sendError(response.SC_NOT_FOUND, mensaje);
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo() {
            return "Short description";
        // </editor-fold>
    }i have a class Conexion wich controls the connection and resultsets
    As you can see, i tested accessing a jpeg file: 1.jpg with FileInputStream, and it works perfectly, but when i try to get an image from Microsoft Access using the resultset the way i did, the browser shows the following message
    The image �http://localhost:8084/Nedermex/serv� cannot be displayed, because it contains errors.
    My table in the database in Access is configured as following
    FieldName::::::::::::::DataType
    ID::::::::::::::::::::::::::::::Number
    Imagen::::::::::::::::::::OLE Object
    Now, when i insert an image in the Imagen field, i select the option "Create from file" and select the jpg file (the one that worked with the FileInputStream) and uncheck the Link option (to save the data in the db
    maybe there is something wrong with the sizes or something....
    please help me here!!!
    thank you!

    Yes it is an sql question
    Consider this as my condition need to fetch records collected in database on 16-4-2012 
    Table name =TEST_REPORT
    i have passed the following query
    Select Serial_Number,System_Date,System_Time,Department,O​perator_Name,Serial_Number,Test_Case,Pass_Fail from TEST_REPORT  where System_Date = 4-16-2012, it displays the entire record from database. i have my vi along with this mail.
    Attachments:
    Report Viewer.vi ‏24 KB

  • Displaying an image from a URL

    I have a program which visits a html page and creates a JComboBox with all the images from that page. When the user selects an image from the combo box it displays that image in a JLabel. This works fine with images that exist, when I try it with an image that doesn't exist I want it to realise that and display a message saying that "the image cannot be found". Heres part of my code that handles the selection:
    public void actionPerformed(ActionEvent f) {
                        JComboBox cb = (JComboBox)f.getSource();
                        String imageName = (String)cb.getSelectedItem();
                        try {
                             imageUrl = new URL(imageName);
                        catch (MalformedURLException ex) {
                             System.out.println("Image Collection Error: " + ex);
                        catch (Exception e) {
                             System.out.println("Some sort of exception: " + e);
                        picture.setIcon(new ImageIcon(imageUrl));
              });When I select a bad link image from the list I was hoping the catch blocks would trap it and I could make adjustments accordingly, this does not happen. No exception is thrown at all.
    Any ideas of what I can do??
    Bow_wow.

    Thanks for your help, I have changed it to the following code:
    ImageIcon imageToDisplay = new ImageIcon(imageUrl);
                        ImageIcon badImage = new ImageIcon("logo.jpg"); // An image I know exists
                        int status = imageToDisplay.getImageLoadStatus();
                        if (status == MediaTracker.COMPLETE) {
                             picture.setIcon(imageToDisplay);
                        else {
                             picture.setIcon(badImage);                              
                        }It works now, thanks again for your help!

  • Help needed for downloading the image from Inage URL

    Hello everyone,
    I need some help regarding setting a timeout for dowloading image from image URL
    Actually I have a hash table with set of image URL's...
    for example:
    http://z.about.com/d/politicalhumor/1/0/-/6/clinton_portrait.jpg
    which gives a image.
    for(Enumeration e = google_image_links.elements() ; e.hasMoreElements() ;) {
                                      //System.out.println("final");
                                       //System.out.println(e.nextElement());
                                       try{
                                            System.out.println("Images download started....");
                                            //System.out.println(e.nextElement());
              //imageio is the BufferedImagereader object     
                                               imageio = ImageIO.read(new URL((String) e.nextElement()));
                                            image_title = created_imagepath +"\\"+ array_words[i] + counter_image_download + "." + "jpg";
                                            img = ImageIO.write(imageio,"jpg", new File(image_title));     
                                            imageio.flush();
                                       }catch(Exception e1){
                                            System.out.print(e1);
                                       if(img){
                                            System.out.println("The image " + image_title + " has been saved to local disk succesfully.");
                                       counter_image_download++;
                                  }//end of for loopi am using the above code to download all the image from the Image URL's that r present in hashtable.
    The problem i have been encountered with is...
    Some URL's does not return any bytes, The code is not totally broken. In such cases, my code is hanging off at that particular URL and waiting to get some output data from the URL. The execution does not proceed furthur But if the URL is a totally broken link, the code is throwing an exception and I am able to handle it successfully.
    But in the case of partially broken links, I am not able to go furthur because the code keeps waiting to get some data.
    So for this reason I want to setup a timer and tell the code to wait for 5-10 min, in that time if it does not get any data, proceed furthur to download other links...
    Please tell me how can I do this.. or plzzz tell me an alternative...
    Please help me ans its a bit urgent plzzzz.
    Thank you,
    chaitanya

    Hello everyone,
    I need some help regarding setting a timeout for dowloading image from image URL
    Actually I have a hash table with set of image URL's...
    for example:
    http://z.about.com/d/politicalhumor/1/0/-/6/clinton_portrait.jpg
    which gives a image.
    for(Enumeration e = google_image_links.elements() ; e.hasMoreElements() ;) {
                                      //System.out.println("final");
                                       //System.out.println(e.nextElement());
                                       try{
                                            System.out.println("Images download started....");
                                            //System.out.println(e.nextElement());
              //imageio is the BufferedImagereader object     
                                               imageio = ImageIO.read(new URL((String) e.nextElement()));
                                            image_title = created_imagepath +"\\"+ array_words[i] + counter_image_download + "." + "jpg";
                                            img = ImageIO.write(imageio,"jpg", new File(image_title));     
                                            imageio.flush();
                                       }catch(Exception e1){
                                            System.out.print(e1);
                                       if(img){
                                            System.out.println("The image " + image_title + " has been saved to local disk succesfully.");
                                       counter_image_download++;
                                  }//end of for loopi am using the above code to download all the image from the Image URL's that r present in hashtable.
    The problem i have been encountered with is...
    Some URL's does not return any bytes, The code is not totally broken. In such cases, my code is hanging off at that particular URL and waiting to get some output data from the URL. The execution does not proceed furthur But if the URL is a totally broken link, the code is throwing an exception and I am able to handle it successfully.
    But in the case of partially broken links, I am not able to go furthur because the code keeps waiting to get some data.
    So for this reason I want to setup a timer and tell the code to wait for 5-10 min, in that time if it does not get any data, proceed furthur to download other links...
    Please tell me how can I do this.. or plzzz tell me an alternative...
    Please help me ans its a bit urgent plzzzz.
    Thank you,
    chaitanya

  • Images from a URL saved to cache?

    Hi all,
    I have an applet, which is required to download alot of images (maybe 100?)
    from different URL's. My question is, will these images be saved to the user's
    cache after viewing the applet for the first time (i.e. will they need to be downloaded
    again next time the applet is viewed, or will the applet load almost strait away, the
    images being loaded from the cache instead?)
    My method for doanloading an image is as follows:
    import java.applet.*;
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    boxUpperLeft = getImage(getDocumentBase(), APPLET_URL+"/misc/box_upperleft.gif");
    waitForImage(boxUpperLeft, this);
    If there is a better method, or one that is guarenteed to download images to the cache to save on download time in future (assuming of course the client's browser is set to store images and such to the cache for faster loading in future), please let me know.
    Thanks in advance
    Jaz
    Edited by: jazza_guy on Oct 2, 2007 11:38 PM

    I guess it's very easy for you to test?

Maybe you are looking for

  • Can we call 10g Report from Form-6i???

    Hi buddies.....Can we call a report developed in 10g reports from a 6i Form using Run_Report_Object???

  • My Iphone5 is hanging and not responding after trying to update

    I tried to update my IPhone 5 to the latest version of ITunes, but it didn't complete the update neither operate as normal it is now dead! My IPhone is16 MB, My laptop is 13 TB and  4 GB processor speed

  • Issue with Scanners beeping

    Hi,     I have an issue with scanners beeping. I have done everything as suggested in SAP Note 371838 and i am successfull in getting the no of beeps on the SAP Screen but the issue is the scanner is not beeping.     The model of the scanner is Inter

  • Locking in persistent object

    Hi Experts, Does persistent object provide locking mechanism for updating data? If yes, How do I do it? Thanks!

  • Simple Encryption

    Hi All, I want to encrypt a simple text as given in the example below BUT I am getting 'java.lang.NoSuchMethodError' Exception at the Cipher.getInstance("DES") method. Please help me or give me some references. Write me at [email protected] This is t