Ayaw po magconnect sa mysql ko. I am using Wamp.
<?php
$DIR_MAIN_FOLDER = '/pcf'; <---Ito po ba yung project folder ko?
$DIR_PHYSICAL = 'C:/xammp/htdocs/'.$DIR_MAIN_FOLDER.'/'; <--- tapos ito magiging C:/wamp/www/
$DB_HOST = 'localhost';
$DB_USER = 'root';
$DB_PASS = '';
$BD_TABLE = 'dbrt';
$target=$_SERVER['SERVER_NAME'].$DIR_MAIN_FOLDER;
// $target="dreams.freetzi.com";
function log_activity($transaction_type, $affected_table="", $affected_UID="", $type="", $type_id="", $name=""){
// save logs to database
if(!isset($_SESSION)){
session_start();
}
if(isset($_SESSION['focal_peson_id'][0])){
$name = $_SESSION['focal_peson_id'][0];
}
$query = "INSERT INTO focal_person_activity_logs ( datetime_logged, IP_used, User, transaction_type, affected_table, affected_UID_field, type, type_id)
VALUES ('".date("Y-m-j H:i:s")."', '".$_SERVER['REMOTE_ADDR']."', '".$name."', '".$transaction_type."', '".$affected_table."', '".$affected_UID."','".$type."', '".$type_id."')";
//echo $query;
insert_update_delete($query);
}
function insert_update_delete($query)
{
global $DB_HOST, $DB_USER,$DB_PASS, $BD_TABLE;
@mysql_connect($DB_HOST, $DB_USER,$DB_PASS);
mysql_select_db($BD_TABLE) or die( "Unable to select database");
mysql_query($query)or die( "Unable to execute query");
mysql_close();
}
?>
<?php
$DIR_MAIN_FOLDER = '/pcf'; <---Ito po ba yung project folder ko?
$DIR_PHYSICAL = 'C:/xammp/htdocs/'.$DIR_MAIN_FOLDER.'/'; <--- tapos ito magiging C:/wamp/www/
$DB_HOST = 'localhost';
$DB_USER = 'root';
$DB_PASS = '';
$BD_TABLE = 'dbrt';
$target=$_SERVER['SERVER_NAME'].$DIR_MAIN_FOLDER;
// $target="dreams.freetzi.com";
function log_activity($transaction_type, $affected_table="", $affected_UID="", $type="", $type_id="", $name=""){
// save logs to database
if(!isset($_SESSION)){
session_start();
}
if(isset($_SESSION['focal_peson_id'][0])){
$name = $_SESSION['focal_peson_id'][0];
}
$query = "INSERT INTO focal_person_activity_logs ( datetime_logged, IP_used, User, transaction_type, affected_table, affected_UID_field, type, type_id)
VALUES ('".date("Y-m-j H:i:s")."', '".$_SERVER['REMOTE_ADDR']."', '".$name."', '".$transaction_type."', '".$affected_table."', '".$affected_UID."','".$type."', '".$type_id."')";
//echo $query;
insert_update_delete($query);
}
function insert_update_delete($query)
{
global $DB_HOST, $DB_USER,$DB_PASS, $BD_TABLE;
@mysql_connect($DB_HOST, $DB_USER,$DB_PASS);
mysql_select_db($BD_TABLE) or die( "Unable to select database");
mysql_query($query)or die( "Unable to execute query");
mysql_close();
}
?>