Hello all,
How is it possible that this function below inserts two rows in my database?
//called like
save_session_db($_SESSION['user_id']);
function save_session_db($session){
include('includes/db-connect.php');
$connectionInfo = array( 'Database' => 'Belior');
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if($conn){
$date = date('l jS \of F Y');
$_SESSION['model_start_date'] = $date;
$tsql = "INSERT INTO User_Session (user_id, date_created) VALUES ('$session', '$date')";
echo 'insert--<br>'.$tsql;
if(sqlsrv_query($conn, $tsql)) {
return true;
}else{
return false;
}
}else{
return false;
}
sqlsrv_close($conn);
}
This function is not called from anywhere else. When I comment the function call above nothing gets inserted into DB. And PHP does not complain about invalid function call, meaning it doesn't get called from anywhere else.
When I uncomment the function call two rows get inserted!!
Thanks all for any help. I am sure its something simple, I just can't figure it out. It was working before, I can't remember what I tweaked.
Update
It looks as if every single page that I have gets loaded twice?! Why? I don't have a htaccess file anywhere that does this?
127.0.0.1 - - [06/Jan/2010:18:34:00 +0000] "GET /webs/end/create.php HTTP/1.1" 200 44830
127.0.0.1 - - [06/Jan/2010:18:34:06 +0000] "GET /webs/end/create.php HTTP/1.1" 200 44830