[PHP-DB] playing longblob media

2008-04-27 Thread Ron

Hi,

How can i retrieve via php a media stored in a mysql database as longblob?

I'd like to be able to retrieve the media and stream it.

TIA

regards,
ron

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] playing longblob media

2008-04-27 Thread Yves Sucaet
What kind of media are you trying to retrieve? Are you trying to retrieve 
the MySQL data and stream that through your script to the client? How big is 
the BLOB?


If nothing else, you'll need to adapt the MIME-type in the header of your 
HTTP-message.


HTH,

Yves

- Original Message - 
From: Ron [EMAIL PROTECTED]

To: php-db@lists.php.net
Sent: Sunday, April 27, 2008 9:15 AM
Subject: [PHP-DB] playing longblob media



Hi,

How can i retrieve via php a media stored in a mysql database as longblob?

I'd like to be able to retrieve the media and stream it.

TIA

regards,
ron

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] playing longblob media

2008-04-27 Thread Philip Thompson

On Apr 27, 2008, at 9:15 AM, Ron wrote:

Hi,

How can i retrieve via php a media stored in a mysql database as  
longblob?


I'd like to be able to retrieve the media and stream it.

TIA

regards,
ron


Just like any other field type. Doesn't matter to PHP what the field  
type is...


?php
$sql = SELECT `longblob_fieldname` FROM `table` WHERE (`id` = '$id')  
LIMIT 1;

$result = mysql_query ($sql);
if (mysql_num_rows ($result)) {
$contents = mysql_result ($result, 0);
}
?

~Philip

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] playing longblob media

2008-04-27 Thread Ron
i'm trying to play a WAV file, this file is a voicemail file generated 
by asterisk pbx. it is stored in mysql and i would like users to be able 
to check their voicemail via web using php script that will retrieve it 
from the db as a wav format already. thank you


Yves Sucaet wrote:
What kind of media are you trying to retrieve? Are you trying to 
retrieve the MySQL data and stream that through your script to the 
client? How big is the BLOB?


If nothing else, you'll need to adapt the MIME-type in the header of 
your HTTP-message.


HTH,

Yves

- Original Message - From: Ron [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Sunday, April 27, 2008 9:15 AM
Subject: [PHP-DB] playing longblob media



Hi,

How can i retrieve via php a media stored in a mysql database as 
longblob?


I'd like to be able to retrieve the media and stream it.

TIA

regards,
ron

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php








--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] playing longblob media

2008-04-27 Thread Chris

Philip Thompson wrote:

On Apr 27, 2008, at 9:15 AM, Ron wrote:

Hi,

How can i retrieve via php a media stored in a mysql database as 
longblob?


I'd like to be able to retrieve the media and stream it.

TIA

regards,
ron


Just like any other field type. Doesn't matter to PHP what the field 
type is...


But it does to the browser.

You'll need to send the appropriate headers for the browser to do the 
right thing, and since it's probably a big field instead of saving it to 
a variable, just echo it out.


No idea what the right headers are though :)

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php