Originally posted by happyse27
Append:
Code:
$filename=~ s/\\/\\\\/g;
Also
This should not work:
Code:
$sql = $dbh->prepare(qq{insert into samples(username, password, email_address, filename) values ( "userhello6", "passhello6", '$email_address', '$filename' ) } );
$sql->execute();
while (my @data = $sql->fetchrow_array()) {
# Print the date from the first four columns in the table
print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "<br>";
}
Because this is an insert statement:
Code:
$sql = $dbh->prepare(qq{insert into samples(username, password, email_address, filename) values ( "userhello6", "passhello6", '$email_address', '$filename' ) } );
Code:
while (my @data = $sql->fetchrow_array()) {
# Print the date from the first four columns in the table
print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "<br>";
also its complaining about: fetch() without execute()
try
Code:
$sql = $dbh->prepare(qq{insert into samples(username, password, email_address, filename) values ( "userhello636", "passhello636", "$email_address", "$filename") } );
$sql->execute() or die "$dbh->errstr\n";;
$sql = $dbh->prepare(qq{SELECT * FROM samples});
while (my @data = $sql->fetchrow_array->execute()) {
# Print the date from the first four columns in the table
print $data[0], "\t", $data[1], "\t", $data[2], "\t", $data[3], "<br>";
Comment