Hay Gas K,

Welcome to the App Engine Google Groups!  If I understand your situation 
correctly, there are several photos stored in a Google Cloud Storage 
bucket.  You would like the your application to display the photos to the 
end user.

How is the list of photos determined?
If the list does not change, the paths to the images could be hardcoded 
though that's not a great practice.  More likely than not, the list will 
change.  Thus, you could use the PHP Client Llibrary with the *Objects: 
list* 
<https://cloud.google.com/storage/docs/json_api/v1/objects/list#examples> API 
to list the objects in a given bucket.  The result will contain the data 
you need to list the photos.

For a more dynamic user experience with likely less network overhead and if 
the list has very few restrictions, I would suggest using the Javascript 
client library from the client side to fetch images.  This can cut down 
some server traffic.

You mention that this the example you posted is not working?  What results 
are you seeing?

On Friday, December 16, 2016 at 12:01:19 PM UTC-5, Gas K. wrote:
>
> Hello i am new with app engine.
>
> I am creating a gallery app.
> I have some images in cloud storage and i want to retrieve them all with a 
> query.
>
> i have create a function like that but it doesnt work.
>
> Any ideias???Thank you!
>
> public static function find_all_photos($sql){
>     global $database;
>
>     $result_set = $database->query($sql);
>    while($row = mysqli_fetch_array($result_set)){
>        $photo = ($row['filename']);
>        $images_file = "gs://my-project-test-150523.appspot.com/".$photo;
>        CloudStorageTools::getImageServingUrl($images_file);
>
>     }
> }
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d6bb7646-6d87-4de6-a1ca-44e4088c71c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to