|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$sql = "SELECT pid1, pid2, pid3, pid4
AS pid1, pid2, pid3, pid4
FROM ".METIN2_PLAYER_INDEX_TABLE."
WHERE id = ".$this->accountID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
$this->firstPID = $row['pid1'];
$this->secondPID = $row['pid2'];
$this->thirdPID = $row['pid3'];
$this->fourthPID = $row['pid4'];
print_r($row['pid1']);
print_r($row['pid2']);
print_r($row['pid3']);
print_r($row['pid4']);
exit;
|
This post has been edited 2 times, last edit by "Sebastian S." (Aug 17th 2012, 7:03pm)

|
|
PHP Source code |
1 2 3 4 5 6 |
$sql = "SELECT ".METIN2_PLAYER_JOB_COLUMN." AS fourthJob
FROM ".METIN2_PLAYER_TABLE."
WHERE ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->fourthPID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
$this->fourthJob = $row['fourthJob'];
|
This post has been edited 1 times, last edit by "Sebastian S." (Aug 18th 2012, 1:10pm)
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
public function getJob() {
$newDB = new MySQLDatabaseExtended(METIN2_MYSQLHOST, METIN2_MYSQLUSER, METIN2_MYSQLPASSWORD, METIN2_MYSQLDATABASE_PLAYER, false, true, true);
$sql = "SELECT ".METIN2_PLAYER_JOB_COLUMN." AS firstJob
FROM ".METIN2_PLAYER_TABLE."
WHERE ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->firstPID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
$this->firstJob = $row['firstJob'];
$sql = "SELECT ".METIN2_PLAYER_JOB_COLUMN." AS secondJob
FROM ".METIN2_PLAYER_TABLE."
WHERE ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->secondPID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
$this->secondJob = $row['secondJob'];
$sql = "SELECT ".METIN2_PLAYER_JOB_COLUMN." AS thirdJob
FROM ".METIN2_PLAYER_TABLE."
WHERE ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->thirdPID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
$this->thirdJob = $row['thirdJob'];
$sql = "SELECT ".METIN2_PLAYER_JOB_COLUMN." AS fourthJob
FROM ".METIN2_PLAYER_TABLE."
WHERE ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->fourthPID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
$this->fourthJob = $row['fourthJob'];
}
|
|
|
MySQL queries |
1 2 3 |
SELECT ".METIN2_PLAYER_JOB_COLUMN." AS jobColumn, ".METIN2_ACCOUNT_ID_COLUMN." AS idColomn FROM ".METIN2_PLAYER_TABLE." WHERE ".METIN2_ACCOUNT_ID_COLUMN." IN (".$this->firstPID.", ".$this->secondPID.", ".$this->thirdPID.", ".$this->fourthPID.")"; |
|
|
PHP Source code |
1 |
if($row['idColomn']==$this->firstPID) $this->firstJob=$row['jobColumn'];
|
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
public function getJob() {
$newDB = new MySQLDatabaseExtended(METIN2_MYSQLHOST, METIN2_MYSQLUSER, METIN2_MYSQLPASSWORD, METIN2_MYSQLDATABASE_PLAYER, false, true, true);
$sql = "SELECT ".METIN2_PLAYER_JOB_COLUMN." AS job, ".METIN2_ACCOUNT_ID_COLUMN." AS id
FROM ".METIN2_PLAYER_TABLE."
WHERE ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->firstPID."
OR ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->secondPID."
OR ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->thirdPID."
OR ".METIN2_ACCOUNT_ID_COLUMN." = ".$this->fourthPID."";
$result = $newDB->sendQuery($sql);
$row = $newDB->fetchArray($result);
foreach($row as $job) {
if($row['id'] == $this->firstPID) $this->firstJob = $row['job'];
if($row['id'] == $this->secondPID) $this->secondJob = $row['job'];
if($row['id'] == $this->thirdPID) $this->thirdJob = $row['job'];
if($row['id'] == $this->fourthPID) $this->fourthJob = $row['job'];
}
print_r($this->firstPID);
echo "<br />";
print_r($this->secondPID);
echo "<br />";
print_r($this->thirdPID);
echo "<br />";
print_r($this->fourthPID);
echo "<br />";
echo "<br />";
print_r($this->firstJob);
echo "<br />";
print_r($this->secondJob);
echo "<br />";
print_r($this->thirdJob);
echo "<br />";
print_r($this->fourthJob);
exit;
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
1439644 12 0 0 2 0 ##SOLL > 5 0 0 |
|
|
PHP Source code |
1 2 3 4 5 6 |
while($row = $newDB->fetchArray($result)) {
if($row['id'] == $this->firstPID) $this->firstJob = $row['job'];
if($row['id'] == $this->secondPID) $this->secondJob = $row['job'];
if($row['id'] == $this->thirdPID) $this->thirdJob = $row['job'];
if($row['id'] == $this->fourthPID) $this->fourthJob = $row['job'];
}
|
Forum Software: Burning Board® 3.1.7, developed by WoltLab® GmbH