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

  • Home
  • SEARCH
  • 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 7974879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:30:18+00:00 2026-06-04T08:30:18+00:00

I am fetching the three values from TUsers using select query where I am

  • 0

I am fetching the three values from TUsers using select query where I am getting the error as

Mysqli statement execute error : Result consisted of more than one row.

I have used DISTINCTROW for avoiding duplication and I am using Zend framework to call the procedure.

Here is the code:

Procedure:

         CREATE DEFINER=`root`@`` PROCEDURE `spfetchloginid`(in securityans   varchar(50),out email varchar(50),out loginidout varchar(50),out useridout varchar(50))
         BEGIN

         SELECT DISTINCTROW Email,login_id,user_id into email,loginidout,useridout  FROM DB.TUsers where SecurityAns=securityans ;

         END

Calling the Procedure in ZendFramework from Controller:

            $db=Zend_Db_Table::getDefaultAdapter();
        $spParams = array(1,'NewValue');
        $stmt = $db->query("CALL   spfetchloginid('$securityans',@email,@loginidout,@useridout)");

        print_r($stmt->fetchAll());
        $stmt->closeCursor();   

        $stmtresult10=$db->query("select @email");
        $email_to=$stmtresult10->fetch();
        $stmtresult10->closeCursor();
        $Emails=$email_to["@email"];
         echo $Emails;  

        $stmtresult11=$db->query("select @loginidout");
        $loginid=$stmtresult11->fetch();
        $stmtresult11->closeCursor();

        $loginids=$loginid["@loginidout"];
        echo $loginids; 

        $stmtresult12=$db->query("select @useridout");
        $userid=$stmtresult12->fetch();
        $stmtresult12->closeCursor();

        $userids=$userid["@useridout"]; 

        echo $userids;

Please tell me any good suggestions when using Zend and My Sql for calling the procedures.

  • 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-04T08:30:19+00:00Added an answer on June 4, 2026 at 8:30 am

    From the fine manual:

    DISTINCT specifies removal of duplicate rows from the result set. […] DISTINCTROW is a synonym for DISTINCT.

    So saying this:

    SELECT DISTINCTROW Email, login_id, user_id
    ...
    where SecurityAns = securityans
    

    just removes duplicates from the result set but if you have multiple rows with the same SecurityAns and they’re all securityans, then your query will return multiple rows. If SecurityAns is an answer to a standard question like “what is your favorite color” or “what was your mother’s maiden name” then you should be expecting a lot of duplicates so SecurityAns is certainly not sufficient to guarantee uniqueness.

    You need to add more to the WHERE clause to guarantee unique results. Or, you could add LIMIT 1 but that’s just a bandage over the real problem.

    You’re also probably running into a problem with your WHERE clause:

    where SecurityAns = securityans
    

    the should be true for every row in the table because I think the securityans column name will be used rather than the securityans parameter. Try using a different parameter name. For example, I see your duplicate problem with a procedure like this:

    create procedure p(in id int, out result int)
    begin
        select id into result from t where id = id;
    end
    

    but not with this version:

    create procedure p(in find_id int, out result int)
    begin
        select id into result from t where id = find_id;
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three select boxes :- select1 select2 select3 , i am fetching data
I'm fetching some data from an MSSQL table using the mssql_fetch_object, but the text
I am fetching some value from another page using jQuery .get() like this <input
The following query returns data right away: SELECT time, value from data order by
$sql = SELECT DISTINCT Branch FROM student_main; $result = mysql_query($sql); $row_num = mysql_num_rows($result); $rows
In my query I am fetching three columns (say A,B and Summary) Summary is
I have a problem fetching values from a MySQL cursor. I create a temporary
I have a LINQ query which is fetching a list of nested objects. from
When fetching a query, is there a penalty for setting the fetch limit to
I am fetching JSON data from my local server and was wondering what functions

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.