-
Warehouse PHP
Hi all :)
i want to see the Warehouse but when i try this:
PHP Code:
$username=$_SESSION['username'];
$query = "Select Items From warehouse Where AccountID='$username'";
$result = mssql_query($query);
$row = mssql_fetch_array($result);
echo $row['Items'];
i get this:
PHP Code:
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
How can i get normal result?
-
Re: Warehouse PHP
open on different program. try notepad ++ or wordpad or notepad only
-
Re: Warehouse PHP
Solution:
PHP Code:
$z=0;
for ($x=1; $x<31; $x++)
{
for ($m=1; $m<9; $m++)
{
$query = "Select substring(Items,($z*16)+1,16) From warehouse Where AccountID='$username'";
$result = mssql_query($query);
$row = mssql_fetch_array($result);
echo bin2hex($row[0]);
echo "<br>";
$z++;
}
}
-
Re: Warehouse PHP
PHP Code:
$item_size = 16;
$slots = 240; // 120 - for no expanded warehouse
$account = 'test';
$query = mssql_query('SELECT CONVERT(TEXT, CONVERT(VARCHAR('.($item_size*$slots).'), Items)) AS Items FROM Warehouse WHERE AccountId = \''.$account.'\'');
if(mssql_num_rows($query)){
$arr = mssql_fetch_array($query);
echo strtoupper(bin2hex($arr['Items']));
}
else{
echo 'Warehouse not created.';
}