Variable Value into MySQL DB
From: Diogo Senai (diogo.senai_at_sistemafieg.org.br)
Date: 12/27/04
- Next message: Ron Goral: "RE: Variable Value into MySQL DB"
- Previous message: Goran Bogdanovic: "Examples about Net::Nessus::Client"
- Next in thread: Ron Goral: "RE: Variable Value into MySQL DB"
- Reply: Ron Goral: "RE: Variable Value into MySQL DB"
- Reply: Joe Mecklin: "Re: Variable Value into MySQL DB"
- Reply: Jonathan Paton: "Re: Variable Value into MySQL DB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Dec 2004 16:08:20 -0200 (BRST) To: beginners@perl.org
Hi guys,
I´m having kind´a problem... Here´s the deal... I´m using CGI so that the
user can, by a browser, type the data that must be recorded into the
database.
I use CGI library to do that... the user type what he wants in the fields,
and these values are sent to some variables... Then, I´d like to record
these variables values in the db... But I just can´t get it done!
I´m using Net::MySQL to do so... when I test the script by writing fixed
values in it, it works fine... but when i try to record variables values
it doesn´t work... could you help me? Here´s my code:
#!/usr/bin/perl
use strict;
use CGI qw/:standard/;
use Net::MySQL;
print header,
start_html('Cadastro de Processos'),
h1('Cadastramento Processos'),
start_form,
"Numero do Processo: ",textfield('process'),br,
"Tipo do Processo: [1-2]",textfield('type'),br,
"Nome do advogado: ",textfield('name'),br,
"Email do advogado: ",textfield('email'),br,
submit,
end_form,
hr,
my $process =param(process);
my $lawyer =param(name);
my $email =param(email);
my $type =param(type);
my $mysql = Net::MySQL->new(
database => 'tj',
user => 'user',
password => 'pass'
);
$mysql->query(q{
INSERT INTO processo (process, name, email, type) VALUES ($process,
$lawyer, $email, $type)
});
- Next message: Ron Goral: "RE: Variable Value into MySQL DB"
- Previous message: Goran Bogdanovic: "Examples about Net::Nessus::Client"
- Next in thread: Ron Goral: "RE: Variable Value into MySQL DB"
- Reply: Ron Goral: "RE: Variable Value into MySQL DB"
- Reply: Joe Mecklin: "Re: Variable Value into MySQL DB"
- Reply: Jonathan Paton: "Re: Variable Value into MySQL DB"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|