Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8106659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:31:52+00:00 2026-06-06T00:31:52+00:00

So just as I began to get a good grasp on MySQL, I found

  • 0

So just as I began to get a good grasp on MySQL, I found out I should be learning about PDO. This is the (unfinished) code I have so far. I’d like to get it working before worrying about adding more password security. When I run the script, the printed message is “Array”. How can I break this down and retrieve the data in the array?

try {
$db = new PDO($dbhost, $dbuser, $dbpassword);
$statement = $db->prepare("select * from users where email = :name");
$statement->execute(array(':name' => $username));
$result = $statement->fetch();
echo $result;}

catch(PDOException $e) {echo $e->getMessage();}

Sorry if this is a silly question; I’ve been searching for a while, but can not find any good examples what match what I’m doing, and I learn better from examples than long, wordy descriptions (such as the PHP manual).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:31:54+00:00Added an answer on June 6, 2026 at 12:31 am

    You might want to review your PHP base first, these pages seems most appropriate:

    http://php.net/manual/en/language.types.array.php

    Then, you can review again the code for Fetch and FetchAll at:

    http://php.net/manual/en/pdostatement.fetch.php

    Note that arrays are the defacto standard when receiving data from any provider, should it be pdo, mysql, mysqli, pgsql, this is why i recommend you review the ARRAY type first, get a good grasp of it, then read PDO stuff again…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get some stuff sorted out about all this async stuff. Let's
I just began reading more about Markov Chain Generators today, and am really intrigued
I've just began learning Python and I've ran into a small problem. I need
I just began using Visual Studio to work on a practice .NET project. I
I just began looking into source control.... And installed subversion from collabnet... I also
I just began working on a little twitter-app using tweepy. is there any kind
So, I've just began playing around with the demo of Skeleton, the responsive grid
I know all about threading applications, but haven't done this over web services before.
I have just started using c++ exceptions and want to get it right. What
I hope that in this post, I can get people's opinions on best practices

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.