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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:03:22+00:00 2026-06-15T07:03:22+00:00

I started using the Tutis login script. I made some changes but the following

  • 0

I started using the Tutis login script. I made some changes but the following is giving me errors:

I want to list all the registered users but the Foreach Loop isn’t working.

I created a new function in the member.class.php:

// Registered Users
public function rusers() 
{
    global $database;

    $notice = new notice;
    $users = $database->query('SELECT id, username, date FROM users');

    $return_form = 1;

    $user = "<table>"
          . "<tr>"
          . "<td>ID</td>"
          . "<td>UserName</td>"
          . "<td>Date</td>"
          . "</tr>";

    // Function in the database.class.php
    $result = $database->foreachloop($users); 

    foreach ($result as $row)
    {
        $user.= "<tr><td>".$row['id']."</td>";
        $user.= "<td>".$row['username']."</td><td>".$row['date']."</td></tr>";
    }
    $user.= "</table>"; 

    /* Combine Data */
    $data = "";

    /* Do we need the login form? */
    if ($return_form == 1) 
    {
        $data .= $user;
    }

    /* Return data */
    return $notice->report() . $data;
}

And added the foreachloop() function in the database.class.php

public function foreachloop($result)
{
    return $this->statement->fetch(PDO::FETCH_ASSOC);
}

But I get the following long error:

*Warning: Illegal string offset 'id' in C:\wamp\www\loginoop3\assets\member.class.php on line 996
Warning: Illegal string offset 'username' in C:\wamp\www\loginoop3\assets\member.class.php on line 997
Warning: Illegal string offset 'date' in C:\wamp\www\loginoop3\assets\member.class.php on line 997
Warning: Illegal string offset 'id' in C:\wamp\www\loginoop3\assets\member.class.php on line 996
Warning: Illegal string offset 'username' in C:\wamp\www\loginoop3\assets\member.class.php on line 997
Warning: Illegal string offset 'date' in C:\wamp\www\loginoop3\assets\member.class.php on line 997*

And the output is:

*ID UserName Date
t   t        t
2   2        2*

Here the 2 number means the user ID and the “t” letter is the “test” username but only show the first letter… And only shows one user but there are more users.

I don’t know whats wrong. Are there someone any suggestion?

This login uses OOP PDO. And I tried to do this changes by the rowCount() as it had a new function in the database.class.php with the following content:

public function affected($result)
{
    return $this->statement->rowCount();
} 
  • 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-15T07:03:23+00:00Added an answer on June 15, 2026 at 7:03 am

    to user961627 (original function from the creator of tutis login):

    Function in member.class.php:

    /**
     * list_users
     *
     * Returns a list of users that are registerd
     */
    public function list_users() {
        global $database;
    
        $users = $database->query('SELECT id, username, date FROM users', null, "fetchAll");
    
        $data = "<table>
    <tr>
        <td>ID</td>
        <td>Username</td>
        <td>Registered</td>
    </tr>";
    
        foreach ($users as $row) {
            $data.= "<tr><td>".$row['id']."</td>";
            $data.= "<td>".$row['username']."</td><td>".$row['date']."</td></tr>";
        }
    
        $data.= "</table>"; 
    
        /* Return data */
        return $data;
    }
    

    Call it by using:

    echo $member->list_users();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started using Overbyte components , used to use Indy but blocking issue made
I started using andEngine yesterday but I'm pretty confused.. I want to make a
I started using Prestashop yesterday so I’m a total beginner, but I've got some
I started using NetBeans today, and it was all going swimmingly, until I came
I started using emacs and slime to develop some little service. I have found
I started using ELMAH and I think its great. I read some documentation online
Just started using Blueprint CSS and now playing with the grids but have a
I started using Pyant recenently to do various build/release tasks but have recently discovered
Started using Quartz.net in my project. But got stuck. Using cron trigger fires only
I started using LESS today. But it's kinda weird. This code does not work.

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.