AltME: Databases

Messages

afsanehsamim
#! "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
TomBon
just rename it to .cgi
you have the correct shebang at the top. apache should recognize it automatically.
don't forget to chmod your cgi to grant execution permission.
afsanehsamim
but my OS is windows 7
i am not using linux

Last message posted 341 weeks ago.