ok I have a prepared statement that looks like this..
$stmt2 = $dbh->prepare('INSERT INTO logs VALUES (logDate,ipAddress,userName,browserType) VALUES (?,?,?,?)');
and I run the statement with code that looks like this ...
if(!$stmt2->execute(array($logDate,$ip,$_POST['username'],$browerType))) {
echo "<p>There was an error in processing your login, please conatact site admin.";
exit;
}else{
//set session and what not here
}
but when I run this I just the error message and I'm not sure why. Here is how I get the values for the query.
$ip = $_SERVER['REMOTE_ADDR'];
$logDate = date("Y-m-d");
$browserType = $_SERVER['HTTP_USER_AGENT'];
Of course the
$_POST['username']
is coming from the form. Any ideas would be great..
Stephen