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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:59:26+00:00 2026-05-22T11:59:26+00:00

i inherited this code from some-one and this only returns the first row it

  • 0

i inherited this code from some-one and this only returns the first row it finds:

function getMessages($userID, $from, $limit)
{
  $id = $_SESSION['user_id'];
  $sql = "SELECT * FROM rc_message_box_table WHERE profile_id_to = {$userID} AND rc_message_box_table.profile_id_from NOT IN (SELECT profile_id_block FROM rc_blocklist_table WHERE profile_id = {$id}) LIMIT {$from}, {$limit}";
  $row = $this->aFetch($sql);
  return $row;
}

function aFetch($sSql)
{   
//print_r($sSql);
$aResults = array();
if(is_string($sSql))
{
      $fnSql = $this->query($sSql);
    }

   while($row = mysql_fetch_assoc($fnSql))
   {
  $aResults[] = $row;
   }
   return  $aResults;       
}

how can i with this code return all rows where profile_id_to = {$userID} ??
thanks

  • 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-22T11:59:27+00:00Added an answer on May 22, 2026 at 11:59 am
    function aFetch($result = false) {
            if($result)
                return mysql_fetch_assoc($result);
            else
                return mysql_fetch_assoc($this->result);
        }
    

    you can use this function.

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

Sidebar

Related Questions

I'm refactoring some code I inherited from a long-gone developer, and I find this:
I have the following code (inherited from someone): <div class=feedback>&nbsp;</div> <form onsubmit=return false autocomplete=off>
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I have inherited a subversion repo which looks like this: https://foo/product/src I want to
I know this is a broad question, but I've inherited several poor performers and
This is a C# question, but really could be language-agnostic I have inherited a
This might be a old question: Why does IEnumerable<T> inherit from IEnumerable ? This
I have a class Application that my global.asax inherits from. The class has this
my global.asax looks like this Imports Castle.Windsor Imports Castle.Windsor.Configuration.Interpreters Public Class MvcApplication Inherits System.Web.HttpApplication

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.