Re: playing longblob media

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux