Ye thats all fine I supposed if you run webpage on same computer as gameserver is. I would not recomend that but hey tis your project :p
If you dont intend to have webserver on same computer then to avoid installing oracle you can only install client.I was thinking something like this...
Making database class than connect to database and keep connection open for quick access.
Code:
include("constants.php");
class MyDB
{
/* Class constructor */
function MyDB(){
/* Make connection to database */
/* oracle database connection defined in contants.php
define("OCI_SERVER", "192.168.1.12");
define("OCI_USER", "alef");
define("OCI_PASS", "password");
define("OCI_SERVICE", "account");
define("SRV_WORLD", "MYworld1");
*/
$this->connection2 = oci_connect(OCI_USER,OCI_PASS,OCI_SERVER ."/". OCI_SERVICE);
if (!$this->connection2) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
}
function oci_addNewUser($username, $password, $email){
$time = date("d/m/y");
$qstring = array();
$qstring[0] = "INSERT INTO AMT_ACCOUNT (ACCOUNTID,PASSWORD) VALUES ('$username','$password')";
$qstring[1] = "INSERT INTO AMT_MASTER VALUES ('$username' ,'$email' ,'18' ,to_timestamp('$time','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('$time','DD/MM/RR HH24:MI:SSXFF'),to_timestamp('$time','DD/MM/RR HH24:MI:SSXFF') ,null ,null ,null ,null ,null ,'N' ,'N' ,'0', null, null, null, null, null, null, null, null)";
$qstring[2] = "INSERT INTO ACCOUNTWORLD (ACCOUNTID, WORLD, BANKMONEY, BANKSIZE) VALUES ('$username', '".SRV_WORLD."', '0', '0')";
for ($i=0; $i<3; $i++){
$q = oci_parse($this->connection2, $qstring[$i]);
oci_execute($q);
}
}
};
$database = new MyDB;
Then you can register new players with
$database->oci_addNewUser($arg1, $arg2, $arg3);