PHP Scripting Forums » PHP Classes Support Forum

HowTo display fotos using Easy PHP Upload

(25 posts)
Great offers not only for geeks!
Your Ad Here

  1. altoyes

    altoyes
    Member

    olaf, yes i will read a book
    thankyou for your time

    do you have an example of what the image display looks like?

    could you have a look as i get an error

    Posted 7 months ago #
  2. read the book and you will know whats wrong there

    Posted 7 months ago #
  3. altoyes

    altoyes
    Member

    it is the object which i do find tricky
    please tell me what i can use instead of object
    i know it is easy
    have you used this EXACT code example yourself?
    OR do i need to change SOME of it?

    do you have an example i could see?

    Posted 7 months ago #
  4. use an array mysql_fetch_assoc(), the php manual has examples for this function

    Posted 7 months ago #
  5. altoyes

    altoyes
    Member

    is there something wrong with my code?
    QUESTION
    should i put something INSTEAD of "uploaded_image" ?
    =======================
    THIS OUTPUTS alt=image INSTEAD of the actual IMAGE
    $query = "SELECT * FROM file_table WHERE id=".$_GET['id'];
    $res = mysql_query($sql);
    $obj = mysql_fetch_array($res);
    echo '<img src="/files/new/'.$obj->uploaded_image.'" alt="alt=image" />';
    ===========================
    SO DOES THIS OUTPUTS alt=image INSTEAD of the actual IMAGE
    $query = "SELECT * FROM file_table WHERE id=".$_GET['id'];
    $result = mysql_query($query) or die('Error : ' . mysql_error());
    while ($myrow = mysql_fetch_array($result));
    $file_name=mysql_result($result,$myrow,"file_name");
    echo '<img src="http://sistersahoy.com/files/new/'.$file_name->uploaded_image.'" alt="alt=image" />';
    ============================

    Posted 7 months ago #
  6. this is what I meant, you need to learn php first...

    $res = mysql_query($sql);
    $obj = mysql_fetch_array($res);
    echo '<img src="/files/new/'.$obj['uploaded_image'].'" alt="alt=image" />';
    Posted 7 months ago #
  7. altoyes

    altoyes
    Member

    yes i do need to learn php

    thank you for the amended code.

    QUESTION
    do i need to replace "uploaded_image" with something else?

    Posted 7 months ago #
  8. "uploaded_image" is the col name in your database table

    Posted 7 months ago #
  9. altoyes

    altoyes
    Member

    eureka, some results yes!

    this is my mistake.

    instead of $sql

    $sql = "SELECT * FROM file_table WHERE id=".$_GET['id'];
    $res = mysql_query($sql);
    $obj = mysql_fetch_array($res);
    echo '<img src="http://sistersahoy.com/files/new/'.$obj['file_name'].'" alt="alt=image" />';

    i had $query

    $query = "SELECT * FROM file_table WHERE id=".$_GET['id'];
    $res = mysql_query($sql);
    $obj = mysql_fetch_array($res);
    echo '<img src="http://sistersahoy.com/files/new/'.$obj['file_name'].'" alt="alt=image" />';
    Posted 7 months ago #
  10. altoyes

    altoyes
    Member

    olaf:
    i kiss you a thousand times
    thankyou thankyou
    AND it only took me 10 hours! that is a fast record for me.
    alto

    olaf, do you recommend links to free online for LEARNING PHP ? is php.net one of the best?

    (FREE, as my internet work is nonprofit, my host is supplied free as the site is registered non-profit)

    Posted 7 months ago #

RSS feed for this topic

Reply »

You must log in to post.