How to only display data based on the username

How to only display data based on the username

Mucca019Mucca019 Posts: 1Questions: 1Answers: 0

I'm still trying to learn the basics of datatables & basically I've got my datatable displaying my whole table correctly.
However, on a different page I want to only select data based on the user logged in.

I basically want to do the following;

$uname = $_SESSION['uname'];

$sql="select * from users where uname = '$uname' ";
$result= mysqli_query($connection, $sql);

but im not sure how to implement this within the datatable code provided.

Any help would be appreciated!
Thanks

Answers

  • allanallan Posts: 61,654Questions: 1Answers: 10,094 Site admin

    the datatable code provided

    Could you clarify what code? DataTables is a client-side library. There are PHP libraries for Editor which have documentation for conditions, but if its just your own PHP that you are using to source the data, you would need to apply the WHERE condition in there.

    Allan

This discussion has been closed.