0

EDIT::

The current code being used is :

  //$username= 'lmfsthefounder';
  $type = "SELECT account_type from user_attribs WHERE username='lmfsthefounder';";
  $type_again = mysql_query($type);
  $row = mysql_fetch_row($type_again);
  $usertype = $row['account_type'];
  echo $usertype;

which returns like this: Home Login Register Usertype is

When I search this query in mysql query explorer, it shows me the value is 1. I need that 1 to echo in my page.

(This should display 'Usertype is 1' in my navigation bar)

user3175451
  • 163
  • 1
  • 14

1 Answers1

0

The mysql function you are looking for is mysql_fetch_assoc (link) instead of mysql_fetch_row.

But please, PLEASE don't use mysql_ functions. The link to the PHP manual tells you the same.

I would recommend trying to teach yourself how to use the mySQL PDO. There are many great tutorials online.

Scopey
  • 6,269
  • 1
  • 22
  • 34
  • I am going to work on that, but I am using an old version of php on my server, so at the moment its safe. I will be converting over to newer code very shortly. – user3175451 Jan 14 '14 at 03:16