AltME: Databases

Messages

afsanehsamim
i need only simple example of that ...plz help me if you can ... i do not have time :( ...i am very begginer in rebol
Arnold
Show what you have got so far, may be you are close.
afsanehsamim
my understanding of work steps is : i have two files *.cgi and *.r  ,in cgi file i created crossword that shows on web page ... in data.r  i have made connectivity with database and create table ... and my codes are as following : in cgi file:
#! "C:/wamp/bin/apache/Apache2.2.11/cgi-bin/rebol-core-278-3-1.exe" -cs
REBOL [Title: "Table"]
print "content-type: text/html^/"
print [<HTML><BODY><TABLE  bgcolor="black" border="1">
{
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="one-one" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="one-two" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="one-three" type="text" size="1"></td>
</tr>
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="two-one" type="text" size="1"></td>
<td style="background:black; width:30px; heigth:30px;" ></td>
<td style="width:30px; height:30px;"><input name="two-three" type="text" size="1"></td>
</tr>
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="three-one" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="three-two" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="three-three" type="text" size="1"></td>
</tr>
}
]
print [</TABLE></BODY></HTML>]
and my data.r codes :
#! "C:/wamp/bin/apache/Apache2.2.11/cgi-bin/rebol-core-278-3-1.exe" -cs
REBOL [Title: "Table"]
print "content-type: text/html^/"
print [<HTML><BODY><TABLE  bgcolor="black" border="1">
{
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="one-one" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="one-two" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="one-three" type="text" size="1"></td>
</tr>
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="two-one" type="text" size="1"></td>
<td style="background:black; width:30px; heigth:30px;" ></td>
<td style="width:30px; height:30px;"><input name="two-three" type="text" size="1"></td>
</tr>
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="three-one" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="three-two" type="text" size="1"></td>
<td style="width:30px; height:30px;"><input name="three-three" type="text" size="1"></td>
</tr>
}
]
print [</TABLE></BODY></HTML>]
sorryyyy
this codes:
REBOL []
do %mysql-protocol.r
db: open mysql://root@localhost/test
insert db {create table data (
    name            varchar(100),
    address         text
  )}
insert db {INSERT into data VALUES
    ('raj', 'pune'),
    ('ekta', 'delhi'),
    ('ankur', 'mumbai')
    
}
insert db "SELECT * from data"
results: copy db
probe results
close db
the second file is only exaple of connectivity
table is differenet
Arnold
what did the probe results show?
afsanehsamim
in rebol interpreter only created table
i mean when i run data.r it creats table
i do not know how should i mix cgi file with database file
the results is like this:
do %data.r
Script: "Untitled" (none)
Script: "MySQL Protocol" (12-Jul-2008)
MySQL protocol loaded
connecting to: localhost
[
    ["raj" "pune"]
    ["ekta" "delhi"]
    ["ankur" "mumbai"]
]
Arnold
you have to mix them something like  
#! "C:/wamp/bin/apache/Apache2.2.11/cgi-bin/rebol-core-278-3-1.exe" -cs
REBOL [Title: "Table"]
do %mysql-protocol.r
db: open mysql://root@localhost/test
insert db {create table data (
    name            varchar(100),
    address         text
  )}
insert db {INSERT into data VALUES
    ('raj', 'pune'),
    ('ekta', 'delhi'),
    ('ankur', 'mumbai')
    
}
insert db "SELECT * from data"
results: copy db
print "content-type: text/html^/"
print [<HTML><BODY><TABLE  bgcolor="black" border="1">
{
<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="one-one" type="text" size="1">}
print results/name
print {</td>}
etc
afsanehsamim
and what extension should i use ? .r ???/
Arnold
learning comes with a lot of try and err even for a 'simple' language as REBOL
Probably yes and have your apache server set up right for .r files
afsanehsamim
you're right,i configured  my apache server  for  cgi ... i think i should configure again

Last message posted 348 weeks ago.