8 Einträge, 1 Seite |
QuoteDBD::mysql::st execute failed: Duplicate entry 'dir' for key 1
1
2
3
4
5
6
7
8
9
10
11
12
13
$dbh = DBI->connect( "$dbms:$dbname","$dbuser","$dbpasswd", {PrintError => 0, RaiseError => 1}) || die
"Verbindung zur Datenbank fehlgeschlagen: $DBI::errstr";
$sql = qq{UPDATE ${table_prefix}config SET config_name= ?, config_value = ?};
$sth = $dbh->prepare( $sql ) or die DBI::errstr;
foreach $conf(@config)
{
($name,$value)=@$conf;
$sth->execute($name,$value);
}
$sth->finish();
$dbh->disconnect();
1
2
3
4
5
6
7
$sql = qq~UPDATE ${table_prefix}config SET config_value = ? WHERE config_name = ?~;
$sth = $dbh->prepare( $sql ) or die DBI::errstr;
foreach $conf(@config)
{
($name,$value)=@$conf;
$sth->execute($value, $name);
$sql = qq~UPDATE ${table_prefix}config SET config_value = ? WHERE config_name = ?~;
qq{UPDATE ${table_prefix}config SET config_name= ?, config_value = ?}
qq{UPDATE ${table_prefix}config SET config_name= ?, config_value = ?}
1
2
3
4
5
6
7
my $table_prefix = 'test_';
my $str = qq{UPDATE ${table_prefix}config SET config_name= ?, config_value = ?};
print "$str\n";
# Ausgabe:
#UPDATE test_config SET config_name= ?, config_value = ?
8 Einträge, 1 Seite |