Jump to content


Photo

[SOLVED] Simple PHP Questions


  • Please log in to reply
1 reply to this topic

#1 casperpaul

casperpaul
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 12 September 2006 - 01:09 AM

I am trying to extract info from db but it keeps returning "Array".  My code is below, any help will be appreciated.

  $conn = db_connect();
  $query = "select first_name from users where email='$email'";
  $result = mysql_query($query);

  $result = mysql_fetch_array($result);
  return $result;
 
Always returns "Array".

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 12 September 2006 - 01:13 AM

   $conn = db_connect();
   $query = "select first_name from users where email='$email'";
   $result = mysql_query($query);
   $row = mysql_fetch_array($result);
   echo $row[first_name];

Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users