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

Error in enabling database #54

Open
badguyp opened this issue May 19, 2021 · 7 comments
Open

Error in enabling database #54

badguyp opened this issue May 19, 2021 · 7 comments
Assignees
Labels
Milestone

Comments

@badguyp
Copy link

badguyp commented May 19, 2021

Expected behavior

Actual behavior

WL@`F%2 6IBXH@1ST%XOGH9

Steps to reproduce the behavior

1.Download the project code
2.Create database
3.Turn on ENABLE_DATABASE(define('ENABLE_DATABASE', TRUE);)
My php version 7.3
My mysql version 5.7
If you can hope for a reply, thank you

@johnnymast
Copy link
Owner

Hi badguyp,

I have noticed and fixed this bug in version 1.5. But I will try to release a fix for you today.

@johnnymast
Copy link
Owner

Update: Inserts for private chat and public chat have manually been tested.

@johnnymast
Copy link
Owner

A new release is out. Could you reimport the database table (I updated the import file) and verify it works now for you?
Once verified I close the issue. Thanks in advance @badguyp

@badguyp
Copy link
Author

badguyp commented May 20, 2021

Hi johnnymast,
I have seen the repaired version and it is very good
I also tried to simply repair the Database.php file.
public function insert(
$to_id = 0,
$from_id = 0,
$message = '',
$ip_address = ''
): void {
$statement = $this->prepare(
"INSERT INTO chat_interactions
SET
to_id = :to_id,
from_id = :from_id,
message = :message,
ip_address = :ip_address"
);

    $statement->execute(
        [
        'to_id' => isset($to_id->id)?$to_id->id:$to_id,
        'from_id' => $from_id,
        'message' => $message,
        'ip_address' => $ip_address
        ]
    );
}

image
Thank you again for your answer to my question, and at the end, please forgive me for my poor English.

@johnnymast
Copy link
Owner

Hello badguyp,

I think in newer php versions (7 and up) this style of code could also be fixed with the following line.

$statement->execute(
            [
                'to_id' => $to_id ?? null,
                'from_id' => $from_id,
                'message' => $message,
                'ip_address' => $ip_address
            ]
        );

PS: Your English is good enough for me. I hope you enjoy your update, I am still working on a 1.5 update that will bring SSL and docker support for the project.

@badguyp
Copy link
Author

badguyp commented May 21, 2021

Hello johnnymast,
Version 1.5 is too timely, this must be a great project

@johnnymast
Copy link
Owner

That is true but i also have 97 repos to take care of :)

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

No branches or pull requests

2 participants