DataTables create table with specified mysql command

DataTables create table with specified mysql command

JustDaweeJustDawee Posts: 2Questions: 0Answers: 0

Hello everyone,

I need help with datatables, I using Editor DataTables, I have a database with stored vehicles, we know the owner of the vehicles, and I want to display the only vehicles what the user owns.
For easier understanding, currently I have an editor table where every rows displayed what is in the vehicles sql table, but I only want to display that the logged in user is owning. The logged in user name is stored in a PHP session so we know that.
I'm using PHP and MySQL, everything working fine, but I cant figure out how to list only that rows where owner is the user.

We know the current users real name by $_SESSION['realname'] in php.

And then, when adding a new, or editing a row in the datatable, the owner is the $_SESSION['realname'] by default.

If someone can help with that I would be appreciate it.
Regards, David

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    You would use where condition for that - this section of the manual should get you going as plenty of examples there,

    Colin

  • JustDaweeJustDawee Posts: 2Questions: 0Answers: 0
    edited April 2022

    That what I was searching for! Thank you so much, its working! Lifesaver!

Sign In or Register to comment.