php 4.3.8 image manipulation help

From: Ron J (cpudoc1_at_jdemco.net)
Date: 09/26/04


Date: Sun, 26 Sep 2004 12:59:22 -0500

I'm trying to copy a jpg binary file stored as a blob in a mysql database to
an html document inside an img tag so I can place the jpg file anywhere on
the html page I choose. I can copy the binary file from the database and
send it to the browser using the code:

<?php
include("dataconnect.php"); // database connection routine
$DB = "main";

$SQL = "select body, itype from pictures where username='$username'"; //
blob file is stored in column 'body'. itype is image/gif

$result = mysql_db_query($DB,$SQL,$dblink);

while($row = mysql_fetch_object($result))

{

$itype = $row->itype;

Header("Content-type: $itype");

$body = $row->body;

echo $body;

flush();

}

?>

This of course sends the file to the browser, not in an IMG tag, and I can
send only one picture per browser page.

Any help is appreciated.



Relevant Pages

  • RE: How to make your SQL Server database grow exponentially with linear data
    ... > We have this database that we use to collect 1000's of rows of data a day. ... > SQL Server reports no free space. ... turns out the problem are with the blob fields. ... > and inserted a new row we probably would have been able to shrink the ...
    (microsoft.public.sqlserver.server)
  • How to make your SQL Server database grow exponentially with linear data
    ... We have this database that we use to collect 1000's of rows of data a day. ... SQL Server reports no free space. ... turns out the problem are with the blob fields. ... of a bigger blob, but they are much lower on the exponential curve than the ...
    (microsoft.public.sqlserver.server)
  • Re: Blobs and SQL Server
    ... Older versions of SQL Server required the blob be loaded in chunks, ... There is a cpu and disk IO hit while inserting the blob. ... Director of Text Mining and Database Strategy ... If a large file is inserted, then it will require many small chunks. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: questions about form action= and onsubmit() handling
    ... They most likely will store up several database updates and do them all at once ("John, here is a list of customers who need to be updated in our database today." ... The alternative seems to be to check every field in the document to determine if it has been changed; decide what table it belongs to, organize them and send this information to the server, or send every changed field and let the server script determine which table, and how to proceed. ... In the HTML document I can have a form named "address" with an input field named "streetNumber" then when I collect data to be updated I know which field on the HTML document corresponds to which database table and field on the server. ... I was comparing how JavaScript would process input elements outside of form tags, ...
    (comp.lang.javascript)
  • Re: Hello: not so much php, more like HTML..?
    ... Jerry would tell you to just serve them up straight from the database, and forget about the filesystem, I'm not so sure:). ... I suspect the answer is that for n files, us the pth root of n as the number of subdirs, where p is the depth of the subdirs...but a lot depends on caching algorithms in the directories. ... I shudder to think how long adding slashes to a 60Mbyte binary image might take, or indeed how much virtual memory holding it in a 60Mbyte php string might use.. ... Anyone ever handled BLOB objects that large, ...
    (comp.lang.php)