Hi All, I am new to phprunner and only have a very basic understanding of SQL so please bear with me.
I have searched the forum for related topics and found numerous posts with various answers but have not had great success in achieving a suitable outcome.
1st question.
I have two tables.
_User
ID INT auto_inc Primary Key
login VCHAR 20
password VCHAR 20
_master
ID INT auto_inc Primary Key
updated TIMESTAMP
user INT
userid VCHAR 20
remote VCHAR 200
host VCHAR 200
I have the below code on EVENT; edit page (after record updated). When a record is updated the only field that is updated it the timestamp but the time offset is out by about +2 hours. Is there any way to fix this other than editing the php.ini (i don't have access to this file) ?
Also the user, userid, remote & host fields don't seem to be updating.
[codebox]global $conn;
$strSQLtmp = "select login from _User where ID = '".$_SESSION['UserID']."'";
$rstmp = db_query($strSQLtmp,$conn);
$datatmp = db_fetch_numarray($rstmp);
$values["user"] = $_SESSION["UserID"];
$values["updated"] = 'now';
if ($datatmp)
$values["userid"] = $datatmp[0];
$values["remote"] = $_SERVER['REMOTE_ADDR'];
if(!$_SERVER['REMOTE_HOST'])
$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
else
$host = $_SERVER['REMOTE_HOST'];
$values["host"] = $host;
return true;[/codebox]
2nd Question
I have another table _complete (in the same db) which has more records than, but is exactly the same (same colums) as _master table.
Is there any easy way I can update the records on the _complete table with the new information in the smaller _master table?
The main difference between the two tables is the primary key, one being ID and the other being SID.
Apologies for the mosnter post but I hope this all makes sence.
Many thanks, Nick