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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:17:03+00:00 2026-06-09T01:17:03+00:00

I have a really strange problem I’ve been trying to work around for a

  • 0

I have a really strange problem I’ve been trying to work around for a while now, but it’s to the point where I can’t anymore.

I have a simple php script. It does some api calls and pulls some data down from facebook and then displays it. For some reason on this page ANY Javascript/jquery that I put in the script just simply does not work. I insert an iframe with the javascript in the source and it works, but if the javascript is in this page it simply doesn’t register. No response at all..the javascript plugin won’t show up, or the function will not fire on-click.

Also MYSQL calls aren’t working either. I simply get nothing back. Has this ever happened to any of you before? Any possible causes?

I don’t think I have any syntax errors..I’ll keep checking though. Any help is much appreciated!!

Here is the first part of my code up until the body, I can’t show the rest unfortunately:

<?php
require 'includes/connection.php';
require 'src/facebook.php';

// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
'appId'  => '~myid~',
'secret' => '~mysecret~',
));

// Get User ID
$user = $facebook->getUser();


// If we have a $user id here, it means we know the user is logged into
// Facebook, but we don't know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.

if ($user) {
 try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
$access_token = $facebook->getAccessToken();

$user_name = $user_profile[first_name];


/*
echo $user;

echo "<br/><br/>";

echo $access_token;
*/

} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}/*elseif($_GET[user]){
$user = $_GET[user];

if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
$access_token = $facebook->getAccessToken();

$user_name = $user_profile[first_name];


/*
echo $user;

echo "<br/><br/>";

echo $access_token;


} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
}*/

// Login or logout url will be needed depending on current user state.

$logoutUrl = $facebook->getLogoutUrl();

$loginUrl = $facebook->getLoginUrl(array('scope'=>'offline_access'));


//Get youtube video ID from URL
// & Linkify youtube URLs which are not already links.
function linkifyYouTubeURLs($text) {
$text = preg_replace('~
    # Match non-linked youtube URL in the wild. (Rev:20111012)
    https?://         # Required scheme. Either http or https.
    (?:[0-9A-Z-]+\.)? # Optional subdomain.
    (?:               # Group host alternatives.
      youtu\.be/      # Either youtu.be,
    | youtube\.com    # or youtube.com followed by
      \S*             # Allow anything up to VIDEO_ID,
      [^\w\-\s]       # but char before ID is non-ID char.
    )                 # End host alternatives.
    ([\w\-]{11})      # $1: VIDEO_ID is exactly 11 chars.
    (?=[^\w\-]|$)     # Assert next char is non-ID or EOS.
    (?!               # Assert URL is not pre-linked.
      [?=&+%\w]*      # Allow URL (query) remainder.
      (?:             # Group pre-linked alternatives.
        [\'"][^<>]*>  # Either inside a start tag,
      | </a>          # or inside <a> element text contents.
      )               # End recognized pre-linked alts.
    )                 # End negative lookahead assertion.
    [?=&+%\w]*        # Consume any URL (query) remainder.
    ~ix', 
    '$1',
    $text);
return $text;
}


// function to convert second to time ( minute and secong format)
function secTomin($secs)
{
$sec = $secs % 60;
if($sec < 10)
{
 $sec = '0'.$sec;
}
$min = floor($secs/60); 
$ret = $min.':'.$sec;
return $ret;
}


//Output Buffering
// make sure output buffering is off before we start it
// this will ensure same effect whether or not ob is enabled already
while (ob_get_level()) {
ob_end_flush();
}
// start output buffering
if (ob_get_length() === false) {
ob_start();
}   

//replace accents
function replaceAccentedCharacters($str)
{
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
$strreplaced = str_replace($search, $replace, $str);
return $strreplaced;
}


?>
<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://connect.soundcloud.com/sdk.js" type="text/JavaScript"></script>
<script src="togglemenu.js" type="text/JavaScript"></script>
<script type="text/JavaScript">
SC.initialize({
client_id: "~mycliendid~",
redirect_uri: "~myurl~",
});
</script>
<script type="text/javascript" src="ajax.js"></script>
<link type="text/css" rel="stylesheet" href="css/jquery-ui-1.8.9.custom/jquery-ui-1.8.9.custom.css" />  

<script type="text/javascript" src="jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="jquery.multi-accordion-1.5.3.js"></script>
<link rel='stylesheet' href='css/lionbars.css' />
<script type="text/javascript" src="jquery.lionbars.0.3.js"></script>

<script type="text/javascript">
$(document).ready(function(){
    $('#song_list').lionbars({
           autohide: true
       });
});
</script>


</head>

None of the javascript in this code is working right now. Also I’ve replaced my app data for facebook and soundcloud in the above code. Sorry it’s a little messy. Wish I could post it all but it’s not up to me. Thanks for your help in advance!

Here is my SQL Statement as requested – actually just a test one I set up w/ the same format:

$query = "SELECT * FROM users WHERE fb_user_id = '$user'";

        $likes = mysql_query($query);

        $num = mysql_num_rows($likes);

        echo $num;

        while ($like_list = mysql_fetch_array($likes, MYSQL_ASSOC)){
            $like = $like_list['fb_from_id'];
            echo $like;

            }
  • 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-09T01:17:04+00:00Added an answer on June 9, 2026 at 1:17 am

    So the problem with the SQL Statement not working was that the table was named with 4 characters, as in like. When I changed it to 5, as in likes, it worked. I had no idea there was a limit on the length of a table name..someone probably would have caught that if I had posted my code. Thanks anyway for all of the help!!

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

Sidebar

Related Questions

I have a really strange problem that I can't explain and fix, it is
Well i have a little problem but really strange. So basically i analyzed URL
Well i have a little problem but really strange. So basically i analyzed URL
I have a strange problem in my code that I really can't explain and
I have a really strange problem where CSS 3D transforms work sometimes and sometimes
I have a really strange problem. My example code works [here][1] quite fine, but
We have a really strange problem in xpages regarding dates, the Notesdocument we have
I have a really strange problem with SQL Server 2008. We have an e-commerce
I have a really strange problem and I'm completely puzzled. I have a piece
I'm having a really strange problem. I have 2 virtual machines running ubuntu 11.4

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.