• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern AAC] PHP error

soul4soul

Intermediate OT User
Joined
Aug 13, 2007
Messages
1,875
Solutions
3
Reaction score
128
Location
USA
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: id
what i have
Code:
$account = $_SESSION['id'];
btw i want the accountid to be stored in account. i have also tried
Code:
$account = (int)($_GET['account']);

edit: alright i got it to work using this but i feel like it was a really stupid way to go about it. so can anyone help me?
Code:
	$ots = POT::getInstance();
	$ots->connect(POT::DB_MYSQL, connection());
	$SQL = $ots->getDBHandle();
	$SQL = $ots->getDBHandle();
	$accountName = $_SESSION['name'];
	foreach($SQL->query('SELECT * FROM accounts WHERE name="'.$accountName.'"') as $data)
		{
		$account=$data['id'];
		}
 
Last edited:
Back
Top