AltME: Databases

Messages

afsanehsamim
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
BrianH
Then you don't have to chmod, you just have to put it in the right directory.
TomBon
correct

afsanehsamim
thank you Arnold.... i van fetch data from database :) ...i am working on compare two values (value that is entered by user and value that is correct )...

Last message posted 115 weeks ago.