ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.3k stars 1.34k forks source link

DISTINCT? #1008

Closed s-vhs closed 1 year ago

s-vhs commented 1 year ago

Hey, it's me once again. I've noticed another function that is missing and possibly would be a great addition: the DISTINCT parameter.

Here's the W3Schools article about it: https://www.w3schools.com/Sql/sql_distinct.asp

Maybe you'll implement this in the near future as well :)

Also, happy new year!

adrianlaraperez88 commented 1 year ago

You can add it in select I use it a lot and working fine !!

On Sat, Dec 31, 2022, 10:35 PM Elysium @.***> wrote:

Hey, it's me once again. I've noticed another function that is missing and possibly would be a great addition: the DISTINCT parameter.

Here's the W3Schools article about it: https://www.w3schools.com/Sql/sql_distinct.asp

Maybe you'll implement this in the near future as well :)

Also, happy new year!

— Reply to this email directly, view it on GitHub https://github.com/ThingEngineer/PHP-MySQLi-Database-Class/issues/1008, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVXRRMFWN5T6ARJ7WJ5U3DWQD3QRANCNFSM6AAAAAATN3Z4QI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

s-vhs commented 1 year ago

Can you give me some kind of example please? I am a little confused and got errors when I tried it...

s-vhs commented 1 year ago

You you mean like this? $conn->orderBy("timestamp", "DESC")->get("blogs_entries", 5, "DISTINCT blog"); Where blog is the Blog ID the entry is from.

s-vhs commented 1 year ago

Yeah. After testing it worked just like that. Thanks!