M
mike
I am using MySQL and this was working, but all of sudden it is not. I
suspect that I have some kind of error, but my error logic must not be
working.
I am getting "Insert - Complete", but no data is getting inserted to
the table.
$sql = "insert into my_posts ( type, head, head_date, msg, trans_date,
poster ) values ( ?, ?, ?, ?, ?, ? )";
$sth = $dbh->prepare( $sql );
if ( !defined $sth )
{
print "Cannot prepare statement: $DBI::errstr\n";
}
else
{
$sth->bind_param('1', $type); $sth->bind_param('2', $head);
$sth->bind_param('3', $head_date); $sth->bind_param('4', $msg);
$sth->bind_param('5', $trans_date); $sth->bind_param('6', $poster);
eval { $sth->execute; };
if ( $@ )
{
print "Error in the database: $@";
}
else
{
# execute worked was success
print "<center><b>Insert - Complete</b></center>\n";
}
}
Any help is appreciated.
Mike
suspect that I have some kind of error, but my error logic must not be
working.
I am getting "Insert - Complete", but no data is getting inserted to
the table.
$sql = "insert into my_posts ( type, head, head_date, msg, trans_date,
poster ) values ( ?, ?, ?, ?, ?, ? )";
$sth = $dbh->prepare( $sql );
if ( !defined $sth )
{
print "Cannot prepare statement: $DBI::errstr\n";
}
else
{
$sth->bind_param('1', $type); $sth->bind_param('2', $head);
$sth->bind_param('3', $head_date); $sth->bind_param('4', $msg);
$sth->bind_param('5', $trans_date); $sth->bind_param('6', $poster);
eval { $sth->execute; };
if ( $@ )
{
print "Error in the database: $@";
}
else
{
# execute worked was success
print "<center><b>Insert - Complete</b></center>\n";
}
}
Any help is appreciated.
Mike