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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:28:49+00:00 2026-05-19T13:28:49+00:00

I am getting an error in MySQL that is driving me crazy and I

  • 0

I am getting an error in MySQL that is driving me crazy and I just can’t figure out what’s wrong. I makes the following call:

CALL ProfileUpdateProgress(107)

MySQL returns the error: “Incorrect number of arguments for FUNCTION ccms.fnGetProfileAlbumsPhotoCount; expected 2, got 1“

Now, as you can see in the code below, the call being made to that function is: fnGetProfileAlbumsPhotoCount(_profileId, profileUserId)

That’s two arguments isn’t it?? Why is it erroring??
I’m going mad!!

Database procs:

DELIMITER $$

DROP PROCEDURE IF EXISTS `ProfileUpdateProgress` $$
CREATE DEFINER=`root`@`%` PROCEDURE `ProfileUpdateProgress`(
        IN _profileId integer
    )
BEGIN

    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

    CALL ProfileUpdateProfileProgress(_profileId);

END $$

DELIMITER ;

which in turn calls:

DELIMITER $$

DROP PROCEDURE IF EXISTS `ProfileUpdateProfileProgress` $$
CREATE DEFINER=`root`@`%` PROCEDURE `ProfileUpdateProfileProgress`(IN _profileId int)
BEGIN

    -- Declarations here

    SELECT profileEyes, profileSex, profileHair, profileBustBand, profileBustCup, profileBirthCountry, profileProfession , profileAbout,
            profileBiography, fnGetProfilePhoto(_profileId, null) AS profilePhoto, fnGetProfileAlbumsPhotoCount(_profileId, profileUserId) AS albumPhotoCount,
            userAllowMultipleProfiles, profileIsPrimary, fnUserGetChildrenProfileCount(userId) AS ownerProfileCount
    INTO  _profileEyes, _profileSex, _profileHair, _profileBustBand, _profileBustCup, _profileBirthCountry, _profileProfession,
           _profileAbout, _profileBiography, _profilePhoto, _albumPhotoCount, _userAllowMultipleProfiles, _profileIsPrimary,
           _ownerProfileCount
    FROM profile
    INNER JOIN user
      ON profileUserId = userId
    WHERE profileId = _profileId;


    -- Other irrelevant code here


END $$

DELIMITER ;

and the function being called that errors looks like:

DELIMITER $$

DROP FUNCTION IF EXISTS `fnGetProfileAlbumsPhotoCount` $$
CREATE DEFINER=`root`@`%` FUNCTION `fnGetProfileAlbumsPhotoCount`(
  _profileId int,
  _userId int
) RETURNS int(11)
BEGIN

  DECLARE outProfileAlbumsPhotoCount int DEFAULT 0;

  -- Irrelvant Code

  RETURN outProfileAlbumsPhotoCount;

END $$

DELIMITER ;
  • 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-19T13:28:50+00:00Added an answer on May 19, 2026 at 1:28 pm

    Ah finally solved it. Another function called fnUserGetChildrenProfileCount in the select columns was the culprit as it too had a call to the fnGetProfileAlbumsPhotoCount() function and THAT call only had one argument, i.e. missing the second one.

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

Sidebar

Related Questions

I just cant figure out why am getting error 1064 from this query //prep
I am getting the error: Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server
I am trying to connect to mysql and am getting an error. I put
Getting a 'marshal data too short' error when trying to install the mysql gem
I keep getting this error: MySQL said: #1064 - You have an error in
I'm getting this error in MySQL create. I'm doing: CREATE TABLE `blogReply` ( `Id`
I'm getting this error: Warning: mysql_connect() [function.mysql-connect]: Too many connections in /home1/host/public_html/employee/message/config.php on line
I am getting this error when my form is completed, despite the fact that
When I load my page I'm getting this error: Fatal error: Can't use function
I am getting the error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL

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.