[Gambas-user] pictures inside a DB

Hamilton Geminiano Andrioli Junior handriolijr at ...626...
Tue Apr 3 19:01:50 CEST 2007


Hi there. I don't know what to do anymore!
I'll explain all my trouble!

Running in Ubuntu 6.10.
Well, my MySQL 5.0 Database for Clientes has 4 blob field named:
foto_compras
foto_finan
foto_fachada
foto_socios

I have to put a picture inside each one.

my code for input the photo is:

PUBLIC SUB Button6_Click()
Mfunc.sData = file.load(label31.Text)
mfunc.rs2 = mfunc.db.edit("clientes", "idclientes=&1", textbox3.text)
mfunc.rs2!foto_finan = MFunc.sData
mfunc.rs2.Update
END

Textbox3.text is my Primary_Key for search.
I have tried to use rs1, rs2, rs3, rs4, each one for each blog field, 
because i thought the same rs was the problem (rs as result), but the 
problem persists.

Then i tried to use sData1, sData2, sData3, sData4 each one for each 
blob fiel, but was not my problem.

in my form, there is 4 picture box, each one has their "Save" button, 
well, i'll try to save them in one command.

The problem is: when i click save for the first picture, it saves. When 
i click save for the second one, the first one become a 8kb field, and 
the second is ok.
The same happens to the other field.

My conclusion:   DB accept only one blob field for each table?
                            What i did wrong?
                            Why db.debug show nothing?
Anyone has a example with more than 3 blob field in the same table to 
send to me?
I really need this feature working. My time is running out...

Please, be patient with me. It's the first time I work with Pictures and 
Database.

I'm wating for answers.
Regards again.
Thanks all for help me!


Hamilton from Brazil







Benoit Minisini escreveu:
> On mardi 3 avril 2007, Hamilton Geminiano Andrioli Junior wrote:
>   
>> Hi all. I still having problems with Picture inside a DB.
>> I using Gambas2 1.9.47, and a MySQL 5.0 DB.
>>
>> The problem is:
>> When i save the first picture, every thing goes all right.
>> I can see the picture, and i can see throught then PhpMySql the size of
>> this picture.
>> When i save the second picture (i have to save 4 pictures in the same
>> registry), the second show the real size of the upload picture, but the
>> first one, come back to 8KB....
>>
>> Please, i'm stoped in this step, and i can not continue without solve
>> this problem.
>>
>> Regards.
>> Hamilton.
>>
>>     
>
> Can you set the DB.Debug property to TRUE? Then Gambas will print all the SQL 
> commands sent to the database. Maybe we can get more information about what 
> happens exactly.
>
> Thanks in advance.
>
> Regards,
>
>   





More information about the User mailing list