AltME: Databases

Messages

Pekr
so in your case it should be:
insert db ["insert into data1(oneone) values(?)" "c"]
or something like:
value: "c"
insert db ["insert into data1(oneone) values(c)" value]
afsanehsamim
but value should not be as constant ! when user put character it should save in values ,now plz tell me how should i write ? i should write like : value:"c"
ishould write like : value :<input ...> ?
@Peker : i am using option one ,but i does not save any value ...
Pekr
you want to save value from the form into the db?
afsanehsamim
yes
afsanehsamim
i  want to save value from the form into the database!
afsanehsamim
any solution?
Pekr
I think, that your script is wrongly constructed! What you seem to do is to just print a form, which then gets delivered to user's browser screen. But at that time, there is no value yet. You should study, how to do CGI in REBOL. You need a separate html form, then you need to read CGI values and store them in a DB ...
plese study following link - on the right side, there is a link, of how to process forms using REBOL: http://www.rebol.com/docs/cgi1.html
this is how you should do it - http://www.rebol.com/docs/cgi2.html
afsanehsamim
but in those links ,i can not find database example! i read that link before ,i created html form and cgi as well, it is working properly ... the point is when user enter input and click submit it goes to cgi page. i need save that input in database ...plz guid me or show me one example how can i save value from the form into db?
Pekr
please use:
values: decode-cgi read-cgi
then you will get block of values IIRC
then you pick a value and save it ...
>> blk: decode-cgi "var1=Petr"
== [var1: "Petr"]
>> type? blk
== block!
>> object: construct blk
>> object
>> object/var1
== "Petr"
so use:
values: decode-cgi read-cgi
result: construct values
insert db ["insert into data1(oneone) values(?)" result/oneone]
afsanehsamim
how can i write <input ...> in block?
Pekr
uh, my question is, if you ever worked with CGI?
examples on the above page are pretty straightforward?
there are two things - 1) you have to write a form, basically a html file, with fields, etc., and submit button, linking it to your cgi script 2) you have to write a CGI script, being able to read submitted values ...

Last message posted 348 weeks ago.