Images from MySQL

Hi;
I'm comfortable sending data to and from python scripts and as3, but what about blobs? I have images stored in MySQL. How should I get these into as3?
Thanks,
Terry

Chrisjuk wrote:
> I would be greatly appreciative if someone could
> do me a quick guide to saving images to MYSQL and then
displaying them in
> Dreamweaver.
Here's an extremely quick guide to saving images in MySQL (or
any other
database for that matter): DON'T DO IT.
Databases are for storing data, not images. Store the images
in the
normal file system, and use the database to store details of
where the
image is located.
Yes, you can store images in a database, but it leads to
table bloat,
and fragmented tables. It also involves quite a lot of
scripting, which
is not automatically generated by Dreamweaver.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Question on retrieve image from mysql

    i want to retrieve image from mysql database and display on GUI
    can anyone tell me how to do
    Thank you

    You can use the JDBC API for Java Database Connectivity. With this you can obtain data from the database using Java. There is an excellent tutorial here at Sun.com: http://www.google.com/search?q=jdbc+tutorial+site:sun.com You can get the MySQL JDBC driver at their own site: http://www.google.com/search?q=download+jdbc+driver+site:mysql.com Get the most recent version which suits your environment. There is also good documentation available over there.
    For displaying in the UI, the approach differs per UI. As you didn't mention which UI you are using, I can't help you further in detail.

  • Retrieving Images from Mysql with PHP

    Hi I have been trying to work this out with no success so some help would be really appreciated.
    I have two tables  in Mysql,
    IMAGES  AND EXHIBITORS
    IMAGES
    `image_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT ,
      `filename` VARCHAR(255) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
      `mime_type` VARCHAR(255) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
      `file_size` INT(11) NOT NULL ,
      `file_data` LONGBLOB NOT NULL ,
      `user_id` VARCHAR(50) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
      `accom_id` INT(5) NOT NULL ,
      `exhibitors_exhib_id1` INT(5) NOT NULL ,
    PRIMARY KEY (`image_id`, `exhibitors_exhib_id1`) ,
    INDEX `user_id` (`user_id` ASC) ,
    INDEX `accom_id` (`accom_id` ASC) ,
    INDEX `fk_images_exhibitors2` (`exhibitors_exhib_id1` ASC) ,
    CONSTRAINT `fk_images_exhibitors2`
    FOREIGN KEY (`exhibitors_exhib_id1` )
    REFERENCES `christmas_shopping`.`exhibitors` (`exhib_id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
    ENGINE = InnoDB
    AUTO_INCREMENT = 7
    DEFAULT CHARACTER SET = latin1
    COLLATE = latin1_bin
    EXHIBITORS
    `exhib_id` INT(5) NOT NULL AUTO_INCREMENT ,
      `exhib_name` VARCHAR(50) CHARACTER SET 'latin1' COLLATE 'latin1_bin' NOT NULL ,
      `exhib_years` SET('2010', '2009') NULL ,
      PRIMARY KEY (`exhib_id`) )
    ENGINE = InnoDB
    AUTO_INCREMENT = 3
    DEFAULT CHARACTER SET = latin1
    COLLATE = latin1_bin
    PACK_KEYS = DEFAULT
    I think I am happy with the Mysql,  and I have read the various arguments about storing images in mysql but for my purpose I wanted to store the image in the database.
    I have already created the upload and the images have uploaded correctly and I can see the data in the database, however I just have been able to retrieve the images back into a webpage.
    I have a .php file which is merging these to tables correctly but the image is displayed as
    o¿9®&#143;áŸÇ½G_ŒÁ%×Úoíø&#157;$M©7ûiè Óµ|Mn.˨â=Ž&#127;2Z ¥<º½Hs/¸úfŠÇðïˆ-üE`· &#157;¯üq÷C[ öTªÂ´ Jnéžl¢âÜdµ (¢µ$(¢Š�(¢Š�(¢Š�(¢Š�(¢Š�(¢Š�CÅ Š:šZ�(¢Š�(¢Š�) -!  ¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¢Š(�¯ ý¤Z_ x^óÃ&#144;K2ZJ»¦ò>ô»NJ ûç¥{6½©.‘£ÝÞ &#144;ÆZ¼*-Sûz"$pÌ]&#157;$þ%5ù¿ æ•0˜xa©;9êý O›=¼³ ªÍÔžÈøžþ t·[c*¦À  T?wøQ·/?ίøWÅ×z]Ü  r츌þæLôoâVþð¯jøÍð¶O Y½Îœ¨Œ›–k4OšWþê·mß1÷/ Abž<[Þ¢þþÕŠþ÷ûÛ&#127;&#157;}nCžÏ*š¡]Þ“ü?¯ëÏ‹ …X¨óÇIþgÔÔVf‹¬Ûë¶)snÙVê½Á:ý¶ &#141;H©ÁÝ=&#143;–iÅÙî QEh   ¢Š(�¢Š(�¢Š(�¢Š(�¤4´‚€ Š(  Š(  Š(  Š(   qKHh Ð ÑE �QE �QE �QE �V^½ª¦‡¥^²ï .í¾µ©^kñÿ�Z  Ã]NmÛY“
    The code I have in the page is as follows. After many hours of trying to work it out I just cant see what I am missing and would really appreciate some help. I have highlighted where the echo is that relates to my image.
    <?php require_once('../Connections/christmas.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    mysql_select_db($database_christmas, $christmas);
    $query_Recordset1 = "SELECT exhibitors.exhib_name, images.file_size, images.file_data FROM images, exhibitors WHERE images.exhib_id = exhibitors.exhib_id";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $christmas) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <?php $pagetitle="The Christmas Shopping Fayre"?>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <meta http-equiv="Content-Type" content="; charset=" />
    <link href="../public/CSSFiles/oneColElsCtrHdr.css" rel="stylesheet" type="text/css" />
    <link href="../public/CSSFiles/whitebackground.css" rel="stylesheet" type="text/css"/>
    <link href="../public/CSSFiles/shoppingonline.css" rel="stylesheet" type="text/css"/>
    <link rel="icon" type="image/x-icon" href="http://www.gravatar.com/avatar/c4dac336c5be729fc542c12bfbb50099.png" />
    <!--[if IE]>
    <style type="text/css">
    a { zoom: 1;}
    </style>
    <![endif]-->
    <script type="text/javascript">
    <!--
    function MM_showHideLayers() { //v9.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3)
      with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
        if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
        obj.visibility=v; }
    //-->
    </script>
    </head>
    <body id="shoppingonline" class="oneColElsCtrHdr">
    <p> </p>
    <?php include("includes/header.php"); ?>
    <br />
    <br />
    <div id="bannersp"> </div>
    <h1>Welcome to <?php echo $pagetitle?></h1>
    <p>
    </p>
    <form method="post" name="form1" id="form1">
    <p> </p>
    <table border="1" cellpadding="5" cellspacing="5">
      <tr>
        <td>exhib_name</td>
        <td>file_size</td>
        <td>file_data</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['exhib_name']; ?></td>
          <td><?php echo $row_Recordset1['file_size']; ?></td>
          <td><?php echo $row_Recordset1['file_data']; ?></td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    <?php include("includes/footer.php"); ?>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

    Hi Murray
    You must despair with beginers like me,  attachments showed as having been
    sent so lets try again.
    I have been able to find a tutorial  that works well all the way through, I
    can even see the images in the browser!!  but only shows images individually
    on a page.
    http://www.phpriot.com/articles/storing-images-in-mysql/7
    However, what I want to do is to have a page that links my images table and
    another table,  all of which I have set up and is working other then showing
    the images.  All was very straight forward until sorting out the image.  If
    I can work out what to take from the above tutorial that works into my page,
    I am sure all will be fab.
    Storing them in the mysql was my preferred method as there are not alot and
    they can be low resolution and I thought it would be fairly straight
    forward!!  however finding out that I am having to adapt code as dreamweaver
    doesn't support the blob attribute is getting me out of my knowledge.
    All the best
    Gilly
    Attachments inserted
    show_image.php
    <?php require_once('../Connections/getImage.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $colname_Recordset1 = "-1";
    if (isset($_GET['image_id'])) {
      $colname_Recordset1 = $_GET['image_id'];
    mysql_select_db($database_getImage, $getImage);
    $query_Recordset1 = sprintf("SELECT image_id, mime_type, file_data FROM images WHERE image_id = %s", GetSQLValueString($colname_Recordset1, "int"));
    $Recordset1 = mysql_query($query_Recordset1, $getImage) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    header('Content-type: ' . $row_getImage['mime_type']);
    echo $row_getImage['file_data'];
    mysql_free_result($Recordset1);
    ?>
    view.php
    <?php require_once('../Connections/getImage.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_Recordset1 = 10;
    $pageNum_Recordset1 = 0;
    if (isset($_GET['pageNum_Recordset1'])) {
      $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
    $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
    mysql_select_db($database_getImage, $getImage);
    $query_Recordset1 = "SELECT * FROM images";
    $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
    $Recordset1 = mysql_query($query_limit_Recordset1, $getImage) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    if (isset($_GET['totalRows_Recordset1'])) {
      $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
    } else {
      $all_Recordset1 = mysql_query($query_Recordset1);
      $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
    $totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <table border="1" cellpadding="5" cellspacing="5">
      <tr>
        <td>image_id</td>
        <td>filename</td>
        <td>mime_type</td>
        <td>file_size</td>
        <td>file_data</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><?php echo $row_Recordset1['image_id']; ?></td>
          <td><?php echo $row_Recordset1['filename']; ?></td>
          <td><?php echo $row_Recordset1['mime_type']; ?></td>
          <td><?php echo $row_Recordset1['file_size']; ?></td>
          <td><?php echo $row_Recordset1['file_data']; ?></td>
          <td><img src="show_image.php?image_id=<?php echo
    $row_getdetails['image_id']; ?>" alt="Image from DB" />
    </td>
        </tr>
        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • Streaming an image from mySql db?

    hi all
    i already stored an image into a mySql database
    now i'd like to write a simple servlet to display it
    anyone could help me?
    thanx
    sandro

    In your servlet set the content type for your image (e.g. image/gif or image/jpeg). Then read the binay data from the database and send it to the browser.
    This may help you
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets_p.html
    http://archive.coreservlets.com/Chapter7.html
    Regards
    BG

  • Displaying images from MySQL data base

    I'm currently developing a Master/Detail
    page set. The MySQL table containing the Detail information includes a 'blob'  (MIME: image/jpeg  - Attributes - BINARY) for storing a small image. Under phpmyadmin the images show where applicable.
    In my Detail page I display the results in a table. All the values display except the image.
    I selected Insert > Image
    When the 'Select Image Source' dialogue appeared set 'select file name from' to Data source
    Selected the data base field from the established records set
    I left the 'Format' as 'None'
    Clicked OK
    Have I omitted to set something? How does Dreamweaver or the PHP code know hto to render this field?
    Hope someone can make some suggestions to resolve this.
    Thanks
    Cliff
    Other possible useful info:
    Developing on Windows XP
    Dreamweaver CS5
    all versions of MySQL, PHP, Apache, IE8, Dreamweaver up to date.

    In my desparation this morning
    I even tried to set up a mirror of your example witha separate table (just the 3 fields) and even that didn't work. The Proxy member was the same as yours except that the script was changed to LocalPHP.php . Therefore I presume that the error must have been in the webpage. Unfortunately I've since deleted the code so I can't send a copy of what I used.
    The only suggestions I could suggest that may help others that are novices are (1) suggested code for the webpage (2) a diagram illustrating how the elements link or relate to each other. Hope that is thought helpful.
    Thanks again
    Cliff

  • Loading And Displaying image From MYSQL

    Hello, How can I load and display picture stored into a MYSQL database in a Swing GUI using for example JLable component.

    establish a connection to ur sql, n
    retireve the record with the images or image url in the db.
    and then load it to a Image icon and set it to a JLabel.

  • How to Retrieve Images from mysql on JSF page

    Hi,
    I want to retrieve all the images which are in my database(mysql) using Netbeans 6.9.1 on a JSF 2.0 page.
    How can i do so? I am using backing bean, i use backing bean methods in JSF.
    Pls help me...
    thanx...

    Hi
    Please first read this
    http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-mysql-windows-server-2008r2/
    You can remote control your MySQl and get data by connection string
    My Blog
    Please use Make as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

  • How to insert, select image from database

    can any one help me to store and retrive image from mySQL database....
    plz can any one send me code for this ?
    thank you

    First of all, I suggest not to do this!! Creates to much overhead on your database. Especially if you have large images that your going to put in the database.
    Otherwise what you could do is create a BLOB that contains the bytes to your image and insert that into your database.

  • Unable retrieve image from database

    Hi,
    I'm using Mysql-database with blob column. I'm trying to show one image on the page. Now I only get red cross, not image.
    I followed advices by jprazak:http://swforum.sun.com/jive/thread.jspa?threadID=47085&tstart=0
    I changed code for my purpose.
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    * DisplayPicture.java
    public class DisplayPicture extends HttpServlet {
    private final String dbUrl="jdbc:mysql://localhost/pictures";
    private final String dbUser="read";
    private final String dbPassword="public";
    /** Creates a new instance of DisplayPicture */
    public DisplayPicture() {
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void destroy() {
    protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String id = request.getParameter("imageid");
    String ct = request.getParameter("contenttype");
    if((ct==null)||(ct.equals(""))) {
    ct = "image/x-jpg";
    System.out.println(("Now displaying image with ID: "+id);
    try {
    ServletOutputStream out = response.getOutputStream();
    response.setContentType(ct);
    out.write(this.getImage(id));
    }catch(Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    processRequest(request, response);
    public String getServletInfo() {
    return "Displays a picture from the database identified by a parameter IMAGEID";;
    private byte[] getImage(String id) {
    Statement sta = null;
    Connection con = null;
    ResultSet rs = null;
    byte[] result = null;
    try {
    java.lang.Class.forName("org.gjt.mm.mysql.Driver");
    con = java.sql.DriverManager.getConnection(dbUrl,dbUser,dbPassword);
    sta = con.createStatement();
    rs = sta.executeQuery("SELECT IMAGE FROM IMAGES WHERE IMAGEID="+id);
    if(rs.next()) {
    result = rs.getBytes("IMAGE");
    }else {
    System.out.println("Could find image with the ID specified or there is a problem with the database connection"););
    rs.close();
    sta.close();
    con.close();
    }catch(Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    return result;
    Then I add to file web.xml
    <servlet>
    <servlet-name>DisplayPicture</servlet-name>
    <servlet-class>DisplayPicture</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>DisplayPicture</servlet-name>
    <url-pattern>/servlets/DisplayPicture</url-pattern>
    </servlet-mapping>
    And image-component to the page, url-value:
    http://localhost:18080/application_name/servlets/DisplayPicture?imageid=1
    I get no errors. What is wrong with this code?
    Thanks

    If I select DEMO_BLOB and BLOBCOL from servers window, I can see in properties window:
    SQL Type BLOB
    Type Name BLOB
    If I select IMAGE column from mysql-table and I can see in properties window this:
    SQL Type LONGVARBINARY
    Type Name longblob
    Could this SQL Type difference be the reason why I can't get images from mysql to the page?

  • Loading Images Dynamically from MySql

    Hello
    I need to load images in my swf file dynamically from MySql
    using PHP. Brief is I have one Swf file and and i want to animate
    image in it but image should be come from dynamic path.. anybody
    can tell me how to do this? if you want more brief then i can
    provide it but it is urgent...
    Thanks in advance

    I'm afriad I don't have a solution to your problem but I was
    curious as to why you would load it from a database vs a directory.
    I know you can have users upload to a directory and a database but
    I don't understand the benifit since I think you'd be adding load
    on the database server. Is it a server side image manipulation
    thing?

  • How to insert a dynamic image from a database

    I've recently started using Dreamweaver CC to set up a Dynamic Website (PHP pages with a mySQL database).  With perseverance and by downloading the new depreciated Server Behaviors and Bindings Panels I've been more or less successful at accomplishing my tasks.  I'm still struggling with getting a image to display from mySQL server data base.  In the Pre CC revisions this was easy and well documented.  I've downloaded the DMXZone HTML5 Data Bindings extension.  I can almost get accomplish my dynamic image task, but the DMXZone HTML5 Data Bindings extension says I must now get the the "unfinished but working on" DMX Zone Database Extension in addition to the HTML5 Data Bindings Extension to select my data source from the database.
    I'm thinking about dumping Dreamweaver CC altogether and just installing CS6 until the path gets better paved.  Any other ideas?  Sample code?  Work around?  Thanks in advance

    KevinatCirris wrote:
    I've recently started using Dreamweaver CC to set up a Dynamic Website (PHP pages with a mySQL database).  With perseverance and by downloading the new depreciated Server Behaviors and Bindings Panels I've been more or less successful at accomplishing my tasks.  I'm still struggling with getting a image to display from mySQL server data base.  In the Pre CC revisions this was easy and well documented.  I've downloaded the DMXZone HTML5 Data Bindings extension.  I can almost get accomplish my dynamic image task, but the DMXZone HTML5 Data Bindings extension says I must now get the the "unfinished but working on" DMX Zone Database Extension in addition to the HTML5 Data Bindings Extension to select my data source from the database.
    I'm thinking about dumping Dreamweaver CC altogether and just installing CS6 until the path gets better paved.  Any other ideas?  Sample code?  Work around?  Thanks in advance
    Really you would do it like any other piece of information in your database.
    Store the actual images in a folder on your server and the image file name in the database - myImage.jpg
    Then echo it to the page following the convention of your other data which is being echoed onto the page:
    <img scr="images/<?php echo $row_rsRecordSetName['images']; ?> alt="" >
    ['images'] above being the name of the database field in which you stored the image name and $row_rsRecordSetName being the variable created by the recordset (yours will be different)

  • JAVA, sqlserver - Need to load an image from the sql server database

    hi,
    I need to load an image from the sql server database using java. I have connected to the database and getting all other records except the records for a photo (datatype = LONGVARBINARY) and Remarks (datatype = LONGVARCHAR).
    I am using java and sql server db. The photo and remarks are stored in the db. and i need to show the image and the remarks fetching them from there.
    I get the error :
    Thread-9 org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
    How can I achieve this?
    Thanks,
    Gargi

    Exactly. And are you using MySQL?
    No. You are using Microsoft SQL server if I have to believe your initial post. A quick google tells me that the dialect class to use is:
    org.hibernate.dialect.SQLServerDialect

  • A Fluid Gallery from MySQL using PHP and various column widths

    I have decided to try the new Fluid Layout option in Dreamweaver. I pull information from a database (MySQL) and use php to present it.
    To show a gallery, I would pull the info and use the repeater code, and something like Tom Muck's horizontal repeater script to create a gallery. The images need to be shown with other text-based information (not just a caption). However, the HR script is a set amount of columns - and I want the number of columns to change depending on the width of the browser.
    So it's more than just a gallery - pulling images from a database with Title = "x" these would be a repeated stylised DIV with multiple texts fields and styles within.
    Let's take the example of a car dealership website it must show the car image, year, prices, description etc all in different style fonts so it can just be a caption to the image.
    So the options are:
    A fixed number of columns for each width: Monitor 5, Tablet 3, Mobile 1. Can this be achieved by having a "IF" statement in the actual code, if width = x use this version of the Horizontal Repeater?
    A fluid version that has 6 columns and as you slide the browser's width you can see the gallery's width has less columns until it reaches 1 for mobile.
    The fluid version would be better.
    Any links to a tutorial or example would be most appreciated.
    Many thanks
    HVR

    The only issue with using <divs> instead of a table to create your grid columns is that you will have to set a minimum height on the <divs> to keep them all at the same depth,much like a table cell construction looks and behaves. If you don't set a minimum height the grid will look all ragged PLUS the very big drawback is the <divs> won't clear if another <div> has more content in it which is going to happen if you include a 'description' of the car as this will never be the same length unless you are prepeared to edit the text.
    See fluid sample below: You can just populate the <divs> from your database and loop through them
    <!DOCTYPE HTML>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    body {
        font-family: verdana;
        font-size: 13px;
    #pageWrapper {
        width: 98%;
        max-width: 980px;
        margin: 0 auto;
        overflow: hidden;
    .imageDetails {
        width: 22.5%;
        float: left;
        margin: 0 0 15px 2%;
        background-color: #CCC;
        padding: 8px 0;
        min-height: 200px;
    dl {
        margin: 0 8px;
        padding: 0;
    dt {
    float: left;
    width: 50%;
    padding: 0 0 5px 0;
    dd {
    text-align: right;
    padding: 0 0 5px 0;
    h3 {
        font-size: 13px;
        margin: 0;
        padding: 8px 8px 5px 8px;
    p {
        margin: 0;
        padding: 0 8px;
    @media screen and (max-width: 760px) {
    .imageDetails {
    width: 30%;
    float: left;
    margin: 0 0 15px 2%;
    background-color: #9F3;
    @media screen and (max-width: 480px) {
    .imageDetails {
    width: 45%;
    float: left;
    margin: 0 0 15px 2%;
    background-color: #FC9;
    @media screen and (max-width: 320px) {
    .imageDetails {
    width: 100%;
    float: none;
    margin: 0 0 15px 0;
    background-color: #9CC;
    </style>
    </head>
    <body>
    <div id="pageWrapper">
    <div class="imageDetails">
    <img src="cars/car_1jpg" alt="">
    <dl>
    <dt>Price</dt>
    <dd>&pound;8500</dd>
    <dt>Year</dt>
    <dd>2009</dd>
    </dl>
    <h3>Description</h3>
    <p>This is a description about the car</p> 
    </div>
    <!-- end imageDetails -->
    <div class="imageDetails">
    <img src="cars/car_1jpg" alt="">
    <dl>
    <dt>Price</dt>
    <dd>&pound;8500</dd>
    <dt>Year</dt>
    <dd>2009</dd>
    </dl>
    <h3>Description</h3>
    <p>This is a description about the car</p>
    </div>
    <!-- end imageDetails -->
    <div class="imageDetails">
    <img src="cars/car_1jpg" alt="">
    <dl>
    <dt>Price</dt>
    <dd>&pound;8500</dd>
    <dt>Year</dt>
    <dd>2009</dd>
    </dl>
    <h3>Description</h3>
    <p>This is a description about the car. This is a description about the car. This is a description about the car.</p> 
    </div>
    <!-- end imageDetails -->
    <div class="imageDetails">
    <img src="cars/car_1jpg" alt="">
    <dl>
    <dt>Price</dt>
    <dd>&pound;8500</dd>
    <dt>Year</dt>
    <dd>2009</dd>
    </dl>
    <h3>Description</h3>
    <p>This is a description about the car</p>
    </div>
    <!-- end imageDetails -->
    <div class="imageDetails">
    <img src="cars/car_1jpg" alt="">
    <dl>
    <dt>Price</dt>
    <dd>&pound;8500</dd>
    <dt>Year</dt>
    <dd>2009</dd>
    </dl>
    <h3>Description</h3>
    <p>This is a description about the car</p> 
    </div>
    <!-- end imageDetails -->
    </div>
    </body>
    </html>

  • Retrieve images from DB and attach them to email through javamail

    Hi,
    I'm trying to use javamail to send emails containing text and images (HTML mail), if I use a physical file in my computer as the image source and use FileDataSource everything works just fine. The problem is that the images in my app are stored into a DB (I'm using MySQL, java struts & DAO), so in order to retrieve & display them I use a jsp that returns a byte array as shown in the example bellow
    <img  src='getImage.jsp?itemId=<bean:write name="item" property="itemId"/>&heigth=180&width=140&imageIndex=1'/>getImage.jsp reads the image from the DB for the specified item and returns an image of size "heigth*witdh", this works fine when invoked from any jsp or java action class, but I can't get it to work to insert an image into an email as attachment
    I've tried to use ByteArrayDataSource and the mail is sent correctly and can be read but the image won't show
    bds = new ByteArrayDataSource("/getImage.jsp?itemId="+itemId+"&heigth=180&width=140&imageIndex=1", "image/jpeg");
    imageMime.setDataHandler(new DataHandler(bds));
    imageMime.setHeader("Content-ID", "<\" + itemId + \">"); // backslashes aren't there in the real code, but if I remove them '+ itemId +' won't show
    mailParts.addBodyPart(imageMime);I've also tried with URLDataSource but can't get it to work either, can somebody plz point me in the right direction?
    thanks in advance
    Edited by: informacionCubica on Jun 8, 2009 3:46 PM

    Hello bshannon,
    Thanks for your answer, I tried your suggestion but when I use URLDataSource I get the error message http 500 (in my original post I said that using URLDataSource the mail was sent but without the image... my mistake, I was getting this same error). I traced the error and I found that it is caused by a null pointer exception... let me explain
    This is the code for the jsp that returns the image:
    4        <jsp:useBean id="coverImage" class="com.mqm.struts.getImageAction" scope="session" />
    5       <%
    6           // Desired size of the image to return
    7           int heigth = Integer.parseInt(request.getParameter("heigth"));
    8          int width = Integer.parseInt(request.getParameter("width"));
    9          
    10          // Each item can have up to 6 images (ordered by id), this indicates wich of one we have to return
    11            int imageIndex = Integer.parseInt(request.getParameter("imageIndex"));
    12        byte[] imgData = coverImage.getItemImageAction(request.getParameter("itemId"), request,heigth, width, imageIndex );
    13        response.setContentType("image/jpeg");
    14        OutputStream o = response.getOutputStream();
    15         o.write(imgData);
    16         o.flush();
    17         out.clearBuffer();
    18         o.close();
            %> getImageAction is my DAO class that actually reads the image data from the DB, when I use this 'getImage.jsp' inside any other jsp in the app it works, but when used as described in the first post the request parameter in the line 12 doesn't have the session info, apparently creates a new session or something and since I use information in the session to create the DAO factory I can't connect to the DB and get this error..
    pls tell me if I explained my self or I'm just talking non sense
    regards

  • Store and Display Image from Database

    Now that MySQL is working (woo hoo!) with JSC, I have a couple of questions for any experts out there...
    1. How would I perform an image or other file upload from a browser?
    2. How would I retrieve and display an image from a db on a jsp page?
    Thanks for any help.

    Craig, I think I have a simpler way to load an image on the page, although for the time being I'm not retrieving from a database, but from the file system. The problem is that I'm not getting the pages to load continuously with new images. At some point it apears that the session gets clogges and can not load new pictures. I'll try to include the page bean code just below. This time I'm not adding the "code" tags because I haven't being successful with that. If you have problems , please, contact me at [email protected].
    The core of the code is in a couple of button_action methods.
    If you need, I can give access to the http server where this is running.
    Luiz
    package untitled;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.std.*;
    import javax.faces.component.*;
    import javax.swing.filechooser.*;
    import javax.swing.*;
    import java.io.*;
    * Creator-managed class.
    * Your code should be placed at the end.
    public class Page1 extends AbstractPageBean {
    private HtmlForm form1 = new HtmlForm();
    private FileSystemView filesystem = FileSystemView.getFileSystemView();
    private File path = new File("C:/Documents and Settings/Luiz Costa/My Documents/Creator/Projects/PictureAlbum/build/images/Isadora\'s Wedding");
    private File[] fileslist = filesystem.getFiles(path, false);
    private int counter = 1;
    private int iw = 0;
    private int ih = 0;
    private Integer aiw = new Integer("1");
    private float aar = 0;
    private float ar = 0;
    private ImageIcon ii = null;
    public HtmlForm getForm1() {
    return form1;
    public void setForm1(HtmlForm hf) {
    this.form1 = hf;
    private HtmlGraphicImage image1 = new HtmlGraphicImage();
    public HtmlGraphicImage getImage1() {
    return image1;
    public void setImage1(HtmlGraphicImage hgi) {
    this.image1 = hgi;
    private HtmlCommandButton button1 = new HtmlCommandButton();
    public HtmlCommandButton getButton1() {
    return button1;
    public void setButton1(HtmlCommandButton hcb) {
    this.button1 = hcb;
    private HtmlCommandButton button2 = new HtmlCommandButton();
    public HtmlCommandButton getButton2() {
    return button2;
    public void setButton2(HtmlCommandButton hcb) {
    this.button2 = hcb;
    private HtmlGraphicImage image2 = new HtmlGraphicImage();
    public HtmlGraphicImage getImage2() {
    return image2;
    public void setImage2(HtmlGraphicImage hgi) {
    this.image2 = hgi;
    private HtmlOutputText outputText1 = new HtmlOutputText();
    public HtmlOutputText getOutputText1() {
    return outputText1;
    public void setOutputText1(HtmlOutputText hot) {
    this.outputText1 = hot;
    * This constructor contains Creator-managed initialization code.
    * Your initialization code can be placed at the end,
    * but, this code will be invoked only the first time the page is rendered,
    * and any properties set in the .jsp file will override settings here.
    public Page1() {
    // Creator-managed initialization code
    try {
    catch ( Exception e) {
    log("Page1 Initialization Failure", e);
    throw new FacesException(e);
    // User provided initialization code
    public String button1_action() {
    // Add your event code here...
    outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"left"+counter);
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image1.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image1.setHeight(""+(int)aar);
    outputText1.setValue(image1.getHeight());
    image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image2.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image2.setHeight(""+(int)aar);
    outputText1.setValue(image2.getHeight());
    image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    counter = (counter-1+fileslist.length) % fileslist.length;
    return null;
    public String button2_action() {
    // Add your event code here...
    outputText1.setValue(fileslist[counter].getAbsoluteFile().getPath()+fileslist.length+"right"+counter);
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image1.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image1.setHeight(""+(int)aar);
    outputText1.setValue(image1.getHeight());
    image1.setUrl("images/Isadora\'s Wedding/"+fileslist[counter].getName());
    ii = new ImageIcon("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    ar = (float)ii.getIconHeight()/(float)ii.getIconWidth();
    // aiw = new Integer(image2.getWidth());
    aiw = new Integer(ii.getIconHeight());
    aar = ar*aiw.intValue();
    image2.setHeight(""+(int)aar);
    outputText1.setValue(image2.getHeight());
    image2.setUrl("images/Isadora\'s Wedding/"+fileslist[(counter + 1 + fileslist.length) % fileslist.length].getName());
    counter = (counter+1+fileslist.length) % fileslist.length;
    return null;
    }

Maybe you are looking for

  • Error while upgrading to 10.1.3.5 from 10.1.3.1

    hi i am trying to upgrade to 10.1.3.5. i ran the bpel upgrade scripts with ORABEL user and it all went fine. I ran ESB upgrade script (upgrade_10131_10135_oracle.sql) with ORAESB user and i am getting errors. Below are the errors - Please help. SQL>

  • How can I tell if my airport card is working?

    My slot loading imac has had an airport card functioning well for years. Currently is it on a wireless network via Airport Express shared with an airport connected ibook. The ibook is connecting easily to the network. For two days the imac will not c

  • Error " M7 185 " consignment stock does not exists with Customer/vendor

    Dear SDN Team, The system is throwing the error "Special stock at customer/vendor 3000000001 does not exist (Notification E M7 185) . The consignment Process has been sucessfully maintained correctly with the customer/vendor in ECC system ,but the CR

  • Why are my applications freezing?

    Safari, iTunes, Google Chrome, Mail, all keep freezing with the rainbow wheel. Sometimes it happens as soon as I enter text into a field, itunes is freezing when I am trying to register my new ipod, this is just ridiculous. This macbook pro is about

  • Variant for Control Query on Bex Broadcaster Filter

    I am trying to create a Bex Broadcaster setting on a query via query designer (query -->Publish --> Bex Broadcaster). In the Filter Navigation Tab, I want include a filter using a control query with variants. My control query has a variable that is s