10 Einträge, 1 Seite |
1
2
3
4
5
...
$user = "peter";
$sth=$dbh->prepare("SELECT user, name FROM tabelle WHERE user=$user && benannt=1");
...
1
2
3
$user = "peter";
$sth=$dbh->prepare("SELECT user, name FROM tabelle WHERE user='$user' && benannt=1");
1
2
3
4
$user = "peter";
$sth=$dbh->prepare("SELECT user, name FROM tabelle WHERE user=? && benannt=1");
$sth->execute($user);
1
2
3
unless ($sth->execute($var1, $var2)) {
die "Error in executing sql: ", $dbh->errstr, "\n\tStatement was: $sql\n";
} # unless
1
2
3
4
5
...
$user = "peter";
$sth=$dbh->prepare("SELECT user, name FROM tabelle WHERE user=$user && benannt=1");
...
$sth=$dbh->prepare("SELECT user, name FROM tabelle WHERE user=$user AND benannt=1");
1
2
3
4
5
$user = "peter";
my $sql = "SELECT user, name FROM tabelle WHERE user=" . $dbh->quote($user) . " AND benannt=1";
unless ($sth=$dbh->prepare($sql)) {
die "Error in sql: ", $dbh->errstr, "\nSQL: $sql\n";
} # unless
1
2
3
4
5
6
7
8
eval { ... mehrere SQL-Anweisungen in Transaktion ...};
if ($@) {
$db->rollback;
die $@;
}
else {
$db->commit;
}
10 Einträge, 1 Seite |