insert FormBuilder fields into database
Posted: Fri Feb 20, 2009 11:15 pm
I am using cmsms 1.5.2 with Form Builder 0.5.11.
I am calling a tag with the form results that connects to the DB and inserts the form fields into it.
I am filling the DB with fields name but I would like to insert the value of the fields.
I am looking for the right format.
Any help is welcome, thanks!!!
The tag is(I have been trying various formats):
I am calling a tag with the form results that connects to the DB and inserts the form fields into it.
I am filling the DB with fields name but I would like to insert the value of the fields.
I am looking for the right format.
Any help is welcome, thanks!!!
The tag is(I have been trying various formats):
Code: Select all
include "config.php";
if(!($db = @mysql_connect($config['db_hostname'],$config['db_username'],$config['db_password']))) //connect to database
die("couldn't connect to the database.");
if(!@mysql_select_db($config['db_name'],$db)) // Select Database
die("database doesn't exist!");
$sql = "INSERT INTO work (
wc_id,
wc_codigo,
wc_nombre,
wc_pais,
wc_ado,
wc_lugar,
wc_hospedaje,
wc_transporte,
wc_start,
wc_end,
wc_proyecto,
wc_trabajo,
wc_tipo,
wc_costo,
wc_moneda
)
VALUES (
'',
'$_POST[$wc_codigo]',
'$_POST[wc_nombre]',
'{$wc_pais}',
'{wc_ado}',
'{wc_lugar}',
'{wc_hospedaje}',
'{wc_transporte}',
'{wc_start}',
'{wc_end}',
'{wc_proyecto}',
'{wc_trabajo}',
'{wc_tipo}',
'{wc_costo}',
'{wc_moneda}'
)";
$res = mysql_query($sql);