-5

I want to retrieve my user profiles and print the profile values on the profile form after the user registers on my site but i keep getting the error mentioned above.

<?php 
   $q ="SELECT * FROM indiviual where email='".$loggedinmail."'"; 
   $result = mysql_query($q); 
   while($data = mysql_fetch_array($result))
   { 
      $fullname = $data['fullname']; 
      echo "$fullname";
   }
?>
John Woo
  • 249,283
  • 65
  • 481
  • 481
Ramz
  • 1
  • 3
  • Is *indiviual* a misspelling? – alex Sep 26 '12 at 05:50
  • thanks alex yes it was now its fine now.I ddin't understand what was causing it because nothing seemed wrong. – Ramz Sep 26 '12 at 06:15
  • [**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). See the [**red box**](http://j.mp/Te9zIL)? Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ). – tereško Apr 15 '13 at 21:46

1 Answers1

1

Your query had an error and returned FALSE (the warning hints at that). Fix that, and write your condition to check for FALSE (with ===).

Even better, step out of the past and use PDO if you can.

alex
  • 460,746
  • 196
  • 858
  • 974