1

Topic: To deduce a picture from basis

DBMS: MS A SQL SERVER 2000 EE
Basis such:
(qwe)
| id:int | im:image |
I pull out a picture from basis here so :

$link = mssql_connect ("127.0.0.1", "login","paswd") or die ("I can not incorporate to the server");
mssql_select_db ("qwe", $link) or die ("H the database is found.");
$res=mssql_query ("SELECT im FROM qwe where id=56")
or die ("SQL ERROR in line". __ LINE __. ", function mysql_query");
$image=mssql_result ($res, 0,0);//we take a variable from ..
$x = strlen ($image);
header ("Content-Length: $x");
header ("Content-type: image/jpeg;");
echo $image;

The picture is deduced not completely... As I understood the certain amount of pixels is deduced a current.... (Thus it is not enough smile)
Before an output on  I try to save a picture

$fil = fopen (' c: \\1.jpg ', "a");
fwrite ($fil, $image);
fclose ($fil);

It is saved too not ....
In basis the picture lies entirely for in Delfi I pull out it without  and I display.

2

Re: To deduce a picture from basis

Correctly I understood, what the glitch only in an output on , what in Delfi a picture is displayed correctly?
What type a field where the picture is stored?

MaxxSoftware, 12/14/2005, 06:43 wrote:

header ("Content-Length: $x");

Remove. Changes will be?

3

Re: To deduce a picture from basis

Aha, a current at  in , in Delfe all without problems. A field of type Image.
No, all remains without , was not primary  (Content-Length), advised to attribute.... To  in a file that is saved too cut off, and  there is earlier a determination are long

4

Re: To deduce a picture from basis

MaxxSoftware, 12/15/2005, 06:52 wrote:

the Field of type Image.

In ms precisely there is such field?

5

Re: To deduce a picture from basis

Mal, 12/15/2005, 13:00 wrote:

In ms precisely is such field?

Certainly.

Guest, 12/15/2005, 14:14 wrote:

the Letter ' b ' specifies that

most, it is saved it is cut off. On a page it is deduced it is cut off...
I can lay out  bases and completely the code...  who understands...

6

Re: To deduce a picture from basis

And it at you cuts on different pictures  or how?

7

Re: To deduce a picture from basis

That deduces such sensation of current N of the first pixels...
- yes, equally
There are assumptions ?

8

Re: To deduce a picture from basis

Pancake...  I stepped at once...

MaxxSoftware, 12/14/2005, 06:43 wrote:

$x = strlen ($image);
header ("Content-Length: $x");

Who to you told, what at you a picture - the text information?
strlen to you all spoils.

9

Re: To deduce a picture from basis

Without it it is exact also... To  as  influences saving in a file??? To mine in any way...
To  it happens before determination are long....
Well it is fine, and how  that? (If simply to remove strlen and content  - that result )

10

Re: To deduce a picture from basis

A file does not influence. Other question that it could cut off. The size under the text is not equal  on graphic file bits.

MaxxSoftware, 12/14/2005, 06:43 wrote:

$image=mssql_result ($res, 0,0);//we take a variable from ..

Try to consider on another.

11

Re: To deduce a picture from basis

For example as?
I here and so  tried

$image = mssql_fetch_assoc ($res);
$fil = fopen (' c: \\1.jpg ', "a");
fwrite ($fil, $image [' im ']);
fclose ($fil);
header ("Content-type: image/jpg;");
echo $image [' im '];

Result

12

Re: To deduce a picture from basis

here it is necessary to dig aside MSSQL, most likely any bug in communication MSSQL <=> PHP. For example,  to it not directly, and through ODBC. As a variant,  to update PHP.

13

Re: To deduce a picture from basis

Tried on 4 PHP and on 5,11 result

<? php
$link = odbc_connect ("DRIVER = {a SQL Server}; SERVER=localhost; DATABASE=qwe", "login", "paswd") or die ("I can not incorporate to the server");
$res = odbc_exec ($link, "SELECT im FROM qwe where id=57");
$image = odbc_result ($res, 1);
header ("Content-type: image/jpeg;");
echo $image;
?>

The same result

14

Re: To deduce a picture from basis

MaxxSoftware, 12/21/2005, 06:44 wrote:

$fil = fopen (' c: \\1.jpg ', "a");

wb try,

15

Re: To deduce a picture from basis

about  with and m about

16

Re: To deduce a picture from basis

Instead of echo print tried?

17

Re: To deduce a picture from basis

Now - yes, does not help...

18

Re: To deduce a picture from basis

Apparently a jamb in library, or a glitch most . On other server tried?