Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display #1

Open
umutcaptain opened this issue Sep 15, 2024 · 10 comments
Open

display #1

umutcaptain opened this issue Sep 15, 2024 · 10 comments

Comments

@umutcaptain
Copy link

how can i display users on my website can u describe it ?

thx

@Madriix
Copy link
Owner

Madriix commented Sep 15, 2024

Here is an example of php code using mysqli :

<?php
$host = 'localhost';
$user = 'your_username';
$password = 'your_password';
$database = 'your_database_name';

$conn = new mysqli($host, $user, $password, $database);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT * FROM unrealircd_users";

$result = $conn->query($sql);

if ($result->num_rows > 0) {
    echo $result->num_rows." results";
    // Loop through the results
    while($row = $result->fetch_assoc()) {
        // Display data for each row (example with `id` and `name` columns)
        echo "ID: " . $row["id"]. " - Nickname: " . $row["name"]. "<br>";
    }
} else {
    echo "0 results";
}

$conn->close();
?>

@umutcaptain
Copy link
Author

tyvm.

my fault is at logs

Warning: Undefined variable $pdo in /var/www/vhosts/ayna.org/httpdocs/istatistik/src/tables/unrealircd_users.php on line 4

Fatal error: Uncaught Error: Call to a member function query() on null in /var/www/vhosts/ayna.org/httpdocs/istatistik/src/tables/unrealircd_users.php:4 Stack trace: #0 {main} thrown in /var/www/vhosts/ayna.org/httpdocs/istatistik/src/tables/unrealircd_users.php on line 4

i will try this code then i ll give feedback.

@umutcaptain
Copy link
Author

users worked very well

i wanted to show user counts in #abc channel but i ve seen that there is no any creation of unrealircd_channel database and at my phpmyadmin i ve never seen any channel name. But users database is working very well. fyi.

@umutcaptain
Copy link
Author

i deleted unrealircd_channels.php and auto or manually it does not create unrealircd_channels.php

it gives error too fyi.

@Madriix
Copy link
Owner

Madriix commented Sep 15, 2024

Is it the unrealircd_channels SQL table that isn't being created, or is there an issue with the PHP file (unrealircd_channels.php)? Check if you have the necessary database permissions.

@umutcaptain
Copy link
Author

umutcaptain commented Sep 16, 2024

https://ayna.org/istatistik/ayna.php

unrealircd_users.php is working well.

unrealircd_channels.php came back when i check stats.php but it is empty. not getting the channel list

but unrealircd_channels.php is empty when i check there. trying to catch count of channel total users.

@Madriix
Copy link
Owner

Madriix commented Sep 16, 2024

Do you see the 'unrealircd_channels' table in PhpMyAdmin ?

I didn't quite understand, what do you want to display on the page ?

@umutcaptain
Copy link
Author

i see unrealircd_channels table yes but it is empty. ( if it has to be empty, pls accept my apologise abt that )

i want to display " total users (count) in #a, #b, and #c channels" and total users (count) in whole network.

@Madriix
Copy link
Owner

Madriix commented Sep 16, 2024

It's not normal that it's empty

@umutcaptain
Copy link
Author

when i wanted to upload unrealircd_channels.php manually, it given errors.
idk what can i do

my unrealircd version is : unrealircd 6.1.7 ( last stable version ) and webpanel last stable version too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants