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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:12:37+00:00 2026-05-27T21:12:37+00:00

OK so I am using OOPHP to communicate between Flash Builder and MYSQL both

  • 0

OK so I am using OOPHP to communicate between Flash Builder and MYSQL both functions work but when i call one of the functions within the other it throws an error

ERROR: Server error MySQL Error – 2014
I have search the Internet and cant find any suitable answers.

Is it because the first function has a lock on the MYSQL database and so the second cant access the database?

The reason i have this problem is in one Table i have the clients country as initials and i have created a second table with what the initials stand for i.e. UK = United Kingdom, i did this as at the time i guess i thought this would be good database practice to save space if the client table went to many records.

So now i am calling a function that gives me a particular client but within that call i wanted to call the second function to change the country initials into the correct country string.

FIRST FUNCTION

public function getClients($item) {

    $stmt = mysqli_prepare($this->connection, "SELECT timestamp, id, fname, lname, dateofbirth, monthofbirth, yearofbirth,
    town, country, sex, rate, comments from $this->tablename WHERE (id = $item)");  
    $this->throwExceptionOnError();

    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();

    $rows = array();

    mysqli_stmt_bind_result($stmt, $row->timestamp, $row->ID, $row->fname, $row->lname, $row->dateofbirth, $row->monthofbirth, 
    $row->yearofbirth, $row->sex, $row->country, $row->town, $row->rate, $row->comments);

    while (mysqli_stmt_fetch($stmt)) {
      $row->fname = ucfirst(substr($row->fname,0,1));
      $row->lname = ucfirst($row->lname);
      $row->town = ucfirst($row->town);
      $row->comments = strip_tags($row->comments);
      $row->lname = (($row->fname) . " " . ($row->lname));
      $row->country = $this->getCountry($row->country);
      $row->yearofbirth = GetAge($row->dateofbirth. '-' .$row->monthofbirth. '-' .$row->yearofbirth);
      $row->Pic_loc = "";
      $row->Pic_loc= "SLAGSIMAGES/".($row->ID)."/image01.jpg";
      $row->timestamp = new DateTime($row->timestamp);
      $rows[] = $row;
      $row = new stdClass();
      mysqli_stmt_bind_result($stmt, $row->timestamp, $row->id,$row->fname,$row->lname,$row->sex,$row->country,$row->town,$row->dateofbirth,
      $row->monthofbirth,$row->yearofbirth, $row->rate, $row->comments);
    }


    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);



    return $rows;
}

And this is the second function that is called by the first

public function getCountry($countrycode) {

    $stmt = mysqli_prepare($this->connection, "SELECT country FROM countrycodes where CountryCodes ='$countrycode'");       
    $this->throwExceptionOnError();

    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();

    $rows = array();

    mysqli_stmt_bind_result($stmt, $row->country);

    while (mysqli_stmt_fetch($stmt)) {
      $rows[] = $row;
      $row = new stdClass();
      mysqli_stmt_bind_result($stmt, $row->country);
    }

    mysqli_stmt_free_result($stmt);
    mysqli_close($this->connection);

    return $rows;
}   

This is the piece of code in the first function that is throwing the error
$row->country = $this->getCountry($row->country);

Sorry if code is a little confusing but thanks in advance for any correct answer or info to tell my brain why it can’t be done.

  • 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-27T21:12:37+00:00Added an answer on May 27, 2026 at 9:12 pm

    “So now I am calling a function that gives me a particular client but within that call I wanted to call the second function to change the country initials into the correct country string”

    Why not just join to the other SQL table in the first function, get the data you need and not have to call a second function?

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

Sidebar

Related Questions

Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
Using report builder 3.0, I have a report that queries a cube. How do
Using Github's Issue Tracker, how can one create an issue tied to an organization
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
using VB.Net2010 I need to call a C# DLL The problem I have is
Using mercurial, I've run into an odd problem where a line from one committer
Using of mobile dialog authentication is working well for other mobile devices except on
Using online interfaces to a version control system is a nice way to have

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.