0

I have problem with query value.

This is working.

$userArray = $database->select("app", "fb_id=14175962160");

but below isn't working. Why?

$user = $facebook->getUser(); // contains my fb id - 14175962160

$userArray = $database->select("app", "fb_id='$user'");
$userArray = $database->select("app", "fb_id=$user");
$userArray = $database->select("app", "fb_id=" . $user);
9
  • What do you mean with "isn't working"? What error message(s) do you get? Commented Jun 1, 2013 at 21:33
  • 2
    Are you trying to run this on a 32bit server? You may be experiencing integer overflow. stackoverflow.com/questions/6505203/… Did you var_dump($user) to see what value it actually contains? Commented Jun 1, 2013 at 21:34
  • I don't believe, that $user = 14175962160, because in this case "fb_id=$user" string is the same as the working string. Commented Jun 1, 2013 at 21:36
  • ah the $user is int(1417596216) and should be int(14175962160). But I don't know why the zero is missing. (string) $user == string(10) "1417596216" Commented Jun 1, 2013 at 21:46
  • @VladimírVolek Try to print $facebook->getUser(); instead of saving it into the variable. What does it give? Commented Jun 1, 2013 at 22:09

1 Answer 1

0

The whole problem was that I manually saved bad fb id to the database (With zero on the end) and I didn't notice that for a day. that's all :D. Thank you guys

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.