I have an application on facebook which has been running smoothly for the past 12 months, however today, it has stopped working due to and offset error as seen below:
**Fatal error**: Cannot use string offset as an array in **/home/username/public_html/application/[login to view URL]** on line **23
**
I have checked the code and have found it to be in the following:
// Get user details from facebook
$get_name="SELECT name, pic_square FROM user WHERE uid = '".$user_id."'";
$get_name_result=$facebook->api_client->fql_query($get_name);
$user_name=$get_name_result[0]['name'];
$profile_pic=$get_name_result[0]['pic_square'];
The error is in this line:
$user_name=$get_name_result[0]['name'];
If i remove the "[0]" the page loads but the data requested isnt sent which is causing the application to break.
I need you to tell me how to fix this issue so the user data requested is displayed when called from my application.
This is an urgent job, and i will be selecting a bidder in the next hour.