Mark Lo writes:
> Hi,
>
> Assume I am using Mysql 3.23.18. i don't think i still need that C++
program.
> Can I retrive the image in the following snytax, if yes, will it use up my server's
> memory.
>
> Assume I have 10,000 row with images in my database.
> my table name is image;
> create table image
> ( product_id varchar(40) not null,
> product_description varchar(40) not null,
> image blob not null,
> primary key (product_id)
> );
>
> Everytime, people click the search button, only 8 images will show up each time.
so
> i use the following syntax to load the image.
>
> require("password.php");
> mysql_select_db("product");
> $query="select * from image where product_description='$find' limit 8, 0" ...then
the
> second times, the same quy hit the button, then the query will show....limit 8,
> 8...and so on...just auto increasement by 8.
>
> $result=mysql_query($query);
> $a=0;
> while($row=mysql_fetch_object($result))
> { $product_id[$a]=($row->product_id);
> $product_description[$a]=($row->product_description);
> $image[$a]=($row->image);
> $a++;
> }
>
> then present the above image[0] to image[8] to the web page.
>
> My question starts here
> if i have eight results/images returned, then the image[1],..[2]...[3]....to [8],
> those image file/array should be saved in the memory as an Array. Is this
correct.??
> If this is correct, then My question is that if I have 50 peoples browsing my web,
> then each of them returned 8 results, that means each people will have image[1 to 8]
> file/array, so according to the mathmatical formula, I will have total 400 arrays
> (image[1 to 8] * 50people). Will 400 image file save as array in this way use a lot
> of memories. (assume each image file size is 20k). How many memory should i use in
> this case. OR What do i have to take concern in this circumstances. Any suggestion
> is helpful.
>
> Thank you so much,
>
> Mark
>
Hi!
Instead of storing images in arrays, why don't you just shoot them out
one after another with WWW page ?? Just like in that C++ example ...
Then no memory will be consumed.
Regards,
Sinisa
+----------------------------------------------------------------------+
| ____ __ _____ _____ ___ == MySQL AB |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic |
| /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+----------------------------------------------------------------------+