database server processing with image in json

database server processing with image in json

lolodevlolodev Posts: 17Questions: 0Answers: 0
edited June 2012 in General
Hi,

i need to show an image in datatables row.
i use server processing example.
i 've add image field in my database, but i don't how write code to display it in datatables rows ?

thanks

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    What do you mean by "image field in my database"? Do you store the images as base64 strings?

    Then you could use this approach http://www.sweeting.org/mark/blog/2005/07/12/base64-encoded-images-embedded-in-html
  • lolodevlolodev Posts: 17Questions: 0Answers: 0
    merci
    non, j'ai mis un lien url vers une image dans un champ type VAR...
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    Ok, i see. But then you can just add in your json?
  • lolodevlolodev Posts: 17Questions: 0Answers: 0
    yse i think but i neewbies and i don't where in PHP code of this example: http://www.datatables.net/release-datatables/examples/data_sources/server_side.html
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    edited June 2012
    I would do modify:

    [code]
    if ( $aColumns[$i] == "version" )
    {
    /* Special output formatting for 'version' column */
    $row[] = ($aRow[ $aColumns[$i] ]=="0") ? '-' : $aRow[ $aColumns[$i] ];
    }
    [/code]

    in the Server side (PHP) code

    e.g.

    [code]
    if ( $aColumns[$i] == "name-of-image-column-here" )
    {
    /* Special output formatting for 'image' column */
    $row[] = '';
    }
    [/code]
  • lolodevlolodev Posts: 17Questions: 0Answers: 0
    Yes it's fun!
    thanks
This discussion has been closed.