Forum Programmation.perl aidez moi

Posté par  .
Étiquettes : aucune
0
11
oct.
2005

bonjour a tous;

j'essaye d'interroger ma base de donnée mysql via perl;

malheuresement , mes script bugs;

mon script est:

!/usr/bin/perl

use DBI();

$dbh= DBI->connect( "DBI:mysql:mydatabase=nabil;host=192.168.1.10",

"",

"",

{'RaiseError' => 1});

my %data= ();

%data=("num_titi" => "12345a","ref_titi" => "89Fd6",

);

$query ="INSERT INTO titi_nab(num_titi,ref_titi) values('$data{"num_titi"}','$d

ata{"ref_titi"}');";

$sth = $dbh->do($query);

print" "titi_nab" $sth->{'mysql_insertid'} "inseree dans la base"!\n"";