Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > Re: pu****ng we...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 1407 of 1490
Post > Topic >>

Re: pu****ng web form params into mysql table

by ricky.zhou@[EMAIL PROTECTED] (Ricky Zhou) Jun 25, 2007 at 06:19 PM

--------------enigC036A7D159359CA3DF40FB67
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Greg Jetter wrote:
> my $query =3D "insert into  tablename=20
> (atablenaem1,atablename2,atablename3)VALUES($SubjPerform,$somthing2,
> $somthing3);
>=20
>=20
> # insert  stuff in the db
>=20
> $dbh->do($query) or die "$DBI::errstr";
To prevent SQL injection, etc.  It's strongly recommended that you use
placeholders, which will automatically escape user-provided input for you=
=2E

my $query =3D "insert into tablename (atablenaem1,atablename2,atablename3=
)
values (? ,?, ?)";
$dbh->do($query, $SubjPerform, $somthing2, $somthing3) or die
"$DBI::errstr";

See
http://search.cpan.org/~timb/DBI-1.57/DBI.pm#Placeholders_and_Bind_Values=

for details.

Hope this helps,
Ricky


--------------enigC036A7D159359CA3DF40FB67
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGgD9gZBKKLMyvSE4RAvG4AKDfU5S9nhjsnKZ7VwC2pntJ6xly8wCfTRKv
9hTQkGgdyZ1AAMeCxFwHLck=
=58x6
-----END PGP SIGNATURE-----

--------------enigC036A7D159359CA3DF40FB67--
 




 6 Posts in Topic:
pushing web form params into mysql table
shadkeene@[EMAIL PROTECTE  2007-06-24 19:39:15 
Re: pushing web form params into mysql table
greg@[EMAIL PROTECTED] (  2007-06-25 14:08:54 
Re: pushing web form params into mysql table
ricky.zhou@[EMAIL PROTECT  2007-06-25 18:19:10 
Re: pushing web form params into mysql table
shadkeene@[EMAIL PROTECTE  2007-06-25 23:19:09 
Re: pushing web form params into mysql table
sdavis2@[EMAIL PROTECTED]  2007-06-26 10:02:34 
Re: pushing web form params into mysql table
shadkeene@[EMAIL PROTECTE  2007-06-25 22:58:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 1:40:58 CDT 2008.