ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I wanted to Know any MySQL command that I can use to insert an image file as it is in a certain field in a database. I've heard that the blob field can store images but i don't know how to add the images and to retrieve them! All the codes I've seen up to now are in PHP which I don't understand!! I am using Java to serve as platform to view and save the images!. Any help would be greatly appreciated !
Yeah I know about that but thats not possible with the app am just doing. In this app, there are multiple computers each having a database for them. The data for each computer are then centralised to a server in another place and then redistributed. Its a sort of Distributed System. This the method of keeping path that process becomes very lenthly and I think that saving the images in the database itself is the best way! So if anyone could tell me how that can be done it would be just great! I know it can be done as I've seen it being done and I've also seen it in the MySQL Documentation... Its just that I Don't know how to do that!! Help Please!!!!
It's whatever you want it to be. In our case, we're:
a) The script is in PHP
b) It generates a random number between 1 and [max image id]
c) It does a PHP/mySql "select image_location,alt_image where image_id=id;"
d) It writes out "<img src=\"$image_location\" alt=\"$alt_image />
So in our case, it's a path relative to the web root.