jQWidgets Forums

jQuery UI Widgets Forums Grid pic load from db

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • pic load from db #7065

    detberlin
    Participant

    dear community,

    my english is not so good so I translated this text with a translation program.

    I hope you understand the problem.

    I’ve been trying to load a picture from a long day database.
    the image data are stored in a binary blob field.
    The following code works.

    $tageartTabellen = "SELECT * FROM arttages";
    $tageartErgebnis = mysql_query($tageartTabellen) or die ("SQL-Fehler: In Abfragedefinitionen 1000: ");

    while($tageArtikelResult = mysql_fetch_array($tageartErgebnis, MYSQL_ASSOC)) {$tbtages[] = array(
    'tagbld01' => $tageArtikelResult['tagbld01']);}
    echo $tbtages[0];

    but now when I fill an array and this by trying to get json_encode read as returnable
    only null.
    here is my attempt to solve this problem.

    $tageartTabellen = "SELECT * FROM arttages";
    $tageartErgebnis = mysql_query($tageartTabellen) or die ("SQL-Fehler: In Abfragedefinitionen 1000: ");

    while($tageArtikelResult = mysql_fetch_array($tageartErgebnis, MYSQL_ASSOC)) {$tbtages[] = array(
    'tagbld01' => $tageArtikelResult['tagbld01']);}
    echo json_encode($tbtages);

    pic load from db #7080

    Peter Stoev
    Keymaster

    Hi detberlin,

    I don’t see an issue in your code and unfortunately I don’t know why the json_encode($tbtages); returns null. However, I found a post which may help in your scenario: http://stackoverflow.com/questions/1972006/json-encode-is-returning-null

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.