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 6613143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:11:00+00:00 2026-05-25T20:11:00+00:00

when I use following code foreach($admin_info as $key => $val) { echo $key. .$val.\n;

  • 0

when I use following code

foreach($admin_info as $key => $val)
{
echo $key."   ".$val."\n";
}

I will get true result:

id 1
username Moein7tl
password 0937afa17f4dc08f3c0e5dc908158370ce64df86
mail moein7tl@gmail.com
added_time 
super_admin 
last_time 
last_ip 
see_user_per 1
change_user_per 1
see_people_per 1
change_people_per 1
add_people_per 1
remove_people_per 1
see_album_per 1
add_album_per 1
change_album_per 1
remove_album_per 1
see_music_per 1
add_music_per 1
change_music_per 1
remove_music_per 1
admin_per 1
yahoo_per 1
status_per 1
pm_per 1
ip_blocking_per 1

but when I use echo ($admin_info['id']); or with other keys, it will make an error and no result will be shown.
where is problem?
–edit
var_dump($admin_info); will return

object(stdClass)#21 (27) { ["id"]=> string(1) "1" ["username"]=> string(8) "Moein7tl" ["password"]=> string(40) "0937afa17f4dc08f3c0e5dc908158370ce64df86" ["mail"]=> string(18) "moein7tl@gmail.com" ["added_time"]=> NULL ["super_admin"]=> string(0) "" ["last_time"]=> NULL ["last_ip"]=> NULL ["see_user_per"]=> string(1) "1" ["change_user_per"]=> string(1) "1" ["see_people_per"]=> string(1) "1" ["change_people_per"]=> string(1) "1" ["add_people_per"]=> string(1) "1" ["remove_people_per"]=> string(1) "1" ["see_album_per"]=> string(1) "1" ["add_album_per"]=> string(1) "1" ["change_album_per"]=> string(1) "1" ["remove_album_per"]=> string(1) "1" ["see_music_per"]=> string(1) "1" ["add_music_per"]=> string(1) "1" ["change_music_per"]=> string(1) "1" ["remove_music_per"]=> string(1) "1" ["admin_per"]=> string(1) "1" ["yahoo_per"]=> string(1) "1" ["status_per"]=> string(1) "1" ["pm_per"]=> string(1) "1" ["ip_blocking_per"]=> string(1) "1" }

  • 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-05-25T20:11:01+00:00Added an answer on May 25, 2026 at 8:11 pm

    I found problem,CodeIgniter will return database result as Object.
    So I should do it like that $admin_info->id and it solves problem.

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

Sidebar

Related Questions

I use the following code to get through each of values foreach (array('facebook', 'twitter',
When I use following code: $text = /*some text*/; $langs = array('en', 'pl'); foreach($langs
the following code #!/usr/bin/env perl use strict; use warnings; my @foo = (0,1,2,3,4); foreach
I use the following code to create countdowns in Javascript. n is the number
I use the following code to compile a cpp file to object file. g++
I use the following code try to create an array of string vectors, I
I use the following code to layout network drives on a system. I want
I use the following code: Calendar calendar = new GregorianCalendar(0,0,0); calendar.set(Calendar.YEAR, 1942); calendar.set(Calendar.MONTH, 3);
I use the following code to allocate a Console for a WinForm application. The
I use the following code: - (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSHTTPURLResponse *)response {

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.