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

  • SEARCH
  • Home
  • 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 6839053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:40:20+00:00 2026-05-26T23:40:20+00:00

I just have a little question about a query making me crazy. I’m working

  • 0

I just have a little question about a query making me crazy.
I’m working with CI, and tis is the first time i’m using this great framework

1—
Okay so I have an insert query working rather well :

$data = array(

 'nom' => $nom,
 'prenom' => $prenom,
 'login' => $prenom.' '.$nom,
 'password' => 'facebook',
 'email' => $fb_data['me']['email'],
 'mobile' => "00",
 'etat' => "1",
 'role' => "1",
 'ville' => 'ville actuelle',
 'facebook_id' => $fb_data['uid'],     
);

$this->db->insert('membre', $data);  

And I don’t understand why it always insert the data twice … !

2—
Then I got a second question :
I just wanna found a user with the related facebook_id so i try that :

$this->db->select('nom');
$this->db->from('membre');
$this->db->where('facebook_id',$fb_data['uid']);
$resultat=$this->db->get();

echo '<pre>';
print_r($resultat);
echo '</pre>';  

I’ve also tried :

$resultat2 = $this->db->get_where('membre',array('facebook_id' => $fb_data['uid']));
echo '<pre>';
print_r($resultat2);
echo '</pre>';  

But in both case, the only array I got is :

CI_DB_mysql_result Object
(
  [conn_id] => Resource id #36
  [result_id] => Resource id #61
  [result_array] => Array
      (
      )

  [result_object] => Array
      (
      )

  [custom_result_object] => Array
      (
      )

  [current_row] => 0
  [num_rows] => 1
  [row_data] =>
)

So the [result_id] is okay, but there is no data (as far as it is supposed to be printed in [row_data] ?) When I simply try on mysql i got the right result with the right member. But with CI, it doesn’t seems to work.

3—
Furthermore, when i Try something like that :

echo $resultat['nom'];  

it isn’t considered as an array ..

So .. yeah, I don’t really understand .. If anyone could enlight me ?

  • 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-26T23:40:21+00:00Added an answer on May 26, 2026 at 11:40 pm

    Don’t forget to use the result() method at the end, otherwise you only get resource. Like this:

    $resultat2 = $this->db->get_where('membre',array('facebook_id' => $fb_data['uid']))->result();
    

    This answers the second and third questions, as for the first I’d need to see how are you calling it – the code looks okay and my bet is you’re probably somehow calling it twice.

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

Sidebar

Related Questions

i just have a little design question. If i got this code public Interface
So, this question may be a little vague, but I have constant discussions about
I just have a little question about running Qt created apps on different operating
mmm, I have just a little confusion about multiple auto declarations in the upcoming
I just started out with C and have very little knowledge about performance issues
I just have a quick question about how to get the length of a
i have a little question about the verbatim environment in latex..... my problem is
I just have a short question about switching the color of sifr objects on
I have several little questions about best practices with JPA (via hibernate). My first
i have a little question about getting access to a method in another controller,

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.