Sorry if this isn't where I'm supposed to put this, first time on this forum, but my question pertains mainly to the php code of my app.
I have a database in MySQL that has a field that contains binary data for pictures that have been uploaded via a flash interface to the server.
I also want my flash interface to be able to view pictures receieved from the server. So the question is, I want to display 20 pictures at a time. Can I select 20 rows and then have php return all 20 at the same time in a way that can be parsed in flash? Or should I just make a loop in flash to call the retrieve script 20 times?
Thanks!
Kyle
php, mysql, flash
Moderator: General Moderators
Re: php, mysql, flash
Kyle,
I believe what you'll want to do is create a php page that will send image headers and an image. So you'll send the image urls to flash in a format like <img src="http://domain/images.php?image_id=12" />
images.php will then pull the image with id 12 and send it to the flash application.
I don't know much about flash though so I have no clue if that will work for you but that is how you would do it for a web page.
I believe what you'll want to do is create a php page that will send image headers and an image. So you'll send the image urls to flash in a format like <img src="http://domain/images.php?image_id=12" />
images.php will then pull the image with id 12 and send it to the flash application.
I don't know much about flash though so I have no clue if that will work for you but that is how you would do it for a web page.
Re: php, mysql, flash
that's a pretty decent idea, though i think i'd have to change around my databases. currently i'm storing the image as binary data in a blog field. so i was hoping i could just like, string the binary datas together with some delimiter or somethiung and parse in flash.
so if i use your way, instead of storing binary data in a field, i should upload/save the picture on the server and then put the file name in the field?
Thanks for the response!
so if i use your way, instead of storing binary data in a field, i should upload/save the picture on the server and then put the file name in the field?
Thanks for the response!
Re: php, mysql, flash
The php file could easily pull the image from the database and send it to the browser/flash application. You'll just need to use PHP's header function to send the appropriate image headers.
It is a much better idea however to store images on the file system rather than in a database for a number of reasons, namely performance.
It is a much better idea however to store images on the file system rather than in a database for a number of reasons, namely performance.
Re: php, mysql, flash
Yeah, I was thinking of going that route anyway now 
Thanks!
Thanks!