Google

PHP MYSQL example image gallery (blob-storage)

Google

PHP MYSQL example image gallery (blob-storage)

You may also like...

20 Responses

  1. duf says:

    Thx for this great example! It really works (except the Create-Table-Stmt … ther’s a ‘)’ to much). But anyway – yesterday I’ve spent hours to find out, why my similar script with PHP5.3 and MySQL did not work. You had the solution! Thanks a lot! It’s really a great Script.

    VA:F [1.9.22_1171]
    Rating: 3.0/5 (2 votes cast)
  2. rajesh says:

    how to retrive the images in to my webpage from data base?
    thanks

    VA:F [1.9.22_1171]
    Rating: 5.0/5 (2 votes cast)
    • admin says:

      Hello Rajesh,

      I have added that section in the code now. It is very easy instead of dynamically adding the image ID in the A HREF tag we can use IMG SRC instead. and call the image..

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  3. Paso says:

    Hi.. I am stuck and I’m a total newbie at php / mysql .. Would be grateful if someone could help me .. how do I add a function to update the title belonging to the individual picture? Thanks in advance! 🙂

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • admin says:

      Hello Paso,

      First of all thank you very much for your comment. Sorry i didn’t exactly understood what you really need but i think you are asking about image title attribute. If that is the case then all you have to do is change the code where we retrieve image from Mysql

      echo "<img width='100' src='".$_SERVER['PHP_SELF']."?show=$id'><br><a href='".$_SERVER['PHP_SELF']."?show=$id'>{$title}</a> – ";
      

      To

      echo "<img title='".$title."' width='100' src='".$_SERVER['PHP_SELF']."?show=$id'><br><a href='".$_SERVER['PHP_SELF']."?show=$id'>{$title}</a> – ";
      

      If otherwise please let me know?

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      • Paso says:

        Thanks for your quick reply .. I was not clear enough in my question .. sorry ..
        I need help with an update function ..
        Instead of deleting a photo and upload it again “just because I need to change the imagetitle or text “I just want to be able to update these title/text-rows !? But I do not know how! 🙁

        I guess it could look like this ..

                 if (isset ($ _POST [‘update’])) // If used selected some photo to update
                 {// In ‘uploaded images form’;
                     $ id = intval ($ _POST [‘update’]);
                     mysql_query (“UPDATE {$ table} SET title = ‘$ title’, text = ‘$ text’ WHERE id = $ id”);
                     $ msg = ‘ Title and Text updated ‘;
                 }

        I hope you now understand what I mean! 🙂

        VA:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
      • Paso says:

        Sorry for my very bad explanation .. that I would need help with is …
        I guess it could start with this? 😉

        mysql_query (“UPDATE {$ table} SET title, text WHERE id = $ id”)

        I hope you understand what I am looking for and can help me !? 🙂

        VA:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
        • admin says:

          Not a problem, All you need to do is create a html form and use 2 input fields one for new title and other for old. Hide the old title input field using simple css.
          Once all set, Use the below mysql query inside the php code that has the GET or POST functionality.

          UPDATE My_new_blob_gallery SET title=$new_title WHERE id=$id AND title=$title
          
          VN:F [1.9.22_1171]
          Rating: 0.0/5 (0 votes cast)
          • paso says:

            Now it was a while since I tried to get my problem solved .. Thanks for your help so far .. But I soon give up .. I’ve tried making a new form and do as you said .. but nothing I do seems to work ! I’m doing something wrong! ” .. Can you please show me how to do this? Pleeeease !! 🙂 I would really appreciate it!
            I just want to update the title and the text belonging to my pictures!
            I’m pretty annoyed at myself right now !! I mean .. how hard can it be? 🙂

            VA:F [1.9.22_1171]
            Rating: 0.0/5 (0 votes cast)
  4. ucky says:

    where the uploaded photos will be displayed?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • admin says:

      Please refer previous comment. I have updated the code accordingly. It will display the images in the “Uploaded Images” section. Please test it from your side.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  5. poygam says:

    Thanks dear.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  6. phponwebsites says:

    Superb. Thanks a lot.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  7. Micheal says:

    I want able to change photo and title. i follow above comment but still not success.. can you send me the complete code for able to change photo and title.. Thanks

    VA:F [1.9.22_1171]
    Rating: 5.0/5 (1 vote cast)
  8. zack says:

    how to change existing photo?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  9. Rakesh Aryal says:

    thanks for this tutorial

    VA:F [1.9.22_1171]
    Rating: 5.0/5 (1 vote cast)
  10. xcaas says:

    which code editor do you use to write code???its very nice.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  11. My thumbnails display a broken image and when I click on the link it tells me it cannot be displayed because it contains errors. Any suggestions would be greatly appreciated! Thank you

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • admin says:

      Hello Deanna,

      Thanks for your comment. Happy to see that you have implemented one of our scripts on your page 🙂

      Please let me know in detail the error you are seeing?

      Regards
      Admin

      VN:F [1.9.22_1171]
      Rating: 5.0/5 (1 vote cast)
  12. Vinay Singh says:

    I like this source code : visit my shopping site that is developed by me.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply

Your email address will not be published. Required fields are marked *