Database: motion_world
table: accounts
columns: id | username | password | register_date | account_level

When i go into HeidiSQL -> Query
and write:

SELECT account_level FROM accounts WHERE username='Sha11e'

it returns: administrator

But if I, in a PHP file, write:


$hi = mysql_query("SELECT account_level FROM accounts WHERE username='Sha11e'");

echo $hi;

I get: Resource Id #3

What the hell? :s

You must first process the result by using mysql_fetch_array() function, then you can work with data returned from query. This function will return an array containing records, if there is a single record, you could write:

$record = mysql_fetch_array($hi,MYSQL_ASSOC);

And access data:

echo $record["account_level"];

If there are more records:

while ($rec=mysql_fetch_array($hi,MYSQL_ASSOC)) {
    echo $rec["account_level"];

I recommend you to study and practice with this function:

Reference to mysql_fetch_array()