AltME: Databases

Messages

afsanehsamim
if  user wants insert values to table and it should save in database ,what is the command for that ???
this command is correct ???  :  insert db ["insert into data1 values (?)" myfields name]
afsanehsamim
guys ,i want insert data into database ,i wrote the following codes but no value save !!...  :(
#! "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 { DROP TABLE IF EXISTS data1;
create table data1 (
    oneone        varchar(1),
    onetwo        varchar(1),  
    onethree      varchar(1),      
    twoone        varchar(1),
    twothree      varchar(1),
    threeone      varchar(1),
    threetwo      varchar(1),
    threethree    varchar(1)
  )}
print "content-type: text/html^/"
print [<HTML><BODY>]
print [<form><input type="submit" value=" submit !" />]
print [<TABLE  bgcolor="black" border="1">]
print {<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="oneone" type="text" size="1">}
insert db ["insert into data1 (oneone) values (?)" ]
results: copy db
print {</td>}
i do not know what  i should write for values(?)... plz help
Pekr
afsanehsamim
i tried that link but no value save in database ... :(
my form should get value from <input name="oneone" type="text">....
in values(?) i should put what???? as i said it should get value from <input ...> !!!!!!
Pekr
nothing
insert db ["insert into data1 values(?)" value-here]
insert db-port [{
    INSERT INTO table1 (First, LastName, Title, Phone)
            values (?, ?, ?, ?)
    } fname lname title phone
]
you see? The use four ? ? ? ?, and after the string { }, there are four values fname lname title phone
afsanehsamim
i completely underestand !!!! but  fname,lname,title,phone are string and before query ,they are defiend as : fname: "Johnny"
lname: "Johnson"
title: "President"
phone: "(707) 555-1212"
i have <input ....>,how should i define it as string????
i should write like  fname:<input name="oneone" type="text" size="1">????
Pekr
what do you want exactly to be put into the database field?
afsanehsamim
character
when i write like this :print [<form><input type="submit" value=" submit !" />]
print [<TABLE  bgcolor="black" border="1">]
print {<tr bgcolor="white">
<td style="width:30px; height:30px;"><input name="oneone" type="text" size="1">}
insert db ["insert into data1(oneone) values(c)"]
results: copy db
print {</td>}
it saves c to database
but it will not save user input

Last message posted 111 weeks ago.