Here in the view data form....i would like to display the data information based on the login session user....The problem of my view form, it display all the data from database tables without any filtering by user login session?
May someone help me how to solve this problem...my head became very headache..😟 😶 😟
May someone help me how to solve this problem...my head became very headache..😟 😶 😟
Hi WAN_GHOST ,
Which version of ChronoConnectivity are you using?
You can filter your results using the WHERE box, to filter by user you'll probably need the User ID which you can get with
Bob
Which version of ChronoConnectivity are you using?
You can filter your results using the WHERE box, to filter by user you'll probably need the User ID which you can get with
<?php
$user =& JFactory::getUser();
$user_id = $user->id;
?>
Bob
I'm not sure about the version..maybe ChronoConnectivity V2 RC3..i write many 'where statement' but it all fail to specifix the data user login...i will try the the code u give one... :wink:
Hurm i already use that code GreyHead but it keep display same things...
Actually i want display some policy information when the user login into our websites. I already create a tables name 'data' that have some information of the policy. What the exactly primary keys i should create to link the data filter as user login. Right know i create 'id' as the primary keys for that 'data' tables.
Because right now, the data is display all the user policy information without filter by the user login eventhough i already use your 'where' statement.
Actually i want display some policy information when the user login into our websites. I already create a tables name 'data' that have some information of the policy. What the exactly primary keys i should create to link the data filter as user login. Right know i create 'id' as the primary keys for that 'data' tables.
Because right now, the data is display all the user policy information without filter by the user login eventhough i already use your 'where' statement.
Hi WAN_GHOST ,
The primary keys aren't very important here. You need to write a valid MySQL 'where' clause that filters the data in the way that you need it. You can use the User id as a filter provided that you have user ids in a column in your table.
Bob
The primary keys aren't very important here. You need to write a valid MySQL 'where' clause that filters the data in the way that you need it. You can use the User id as a filter provided that you have user ids in a column in your table.
Bob
I made this work with following code:
If you want to filter by username, change COLUMN NAME to the name of your column.
If you want to filter by user id, change COLUMN NAME to the name of your column.
You also can use name instead of username and id.
If you want to filter by username, change COLUMN NAME to the name of your column.
<?php
$user =& JFactory::getUser();
echo "`COLUMN NAME` = '{$user->username}'";
?>
If you want to filter by user id, change COLUMN NAME to the name of your column.
<?php
$user =& JFactory::getUser();
echo "`COLUMN NAME` = '{$user->id}'";
?>
You also can use name instead of username and id.
Hi,
I also wish to filter out those who login can just view their own data, I tried the all the following codes in the WHERE clause still din't get it work, any other suggestions ??
I also wish to filter out those who login can just view their own data, I tried the all the following codes in the WHERE clause still din't get it work, any other suggestions ??
Please show us your code.
Hi admin,
I'm not really sure what to put in the WHERE but I used the example codes above:
I did not use user_id, since my table have the username column which is the same with the Joomla! login 'username', do I have to link with the session or something else in the WHERE box?
**If I want to join another table, which the columns are similar with the previous table into the connection, what should I do in the join option ?
(because of some personal issues that the tables are done separated.)
I'm not really sure what to put in the WHERE but I used the example codes above:
<?php
$user =& JFactory::getUser();
echo "username = '{$user->username}'";
?>
I did not use user_id, since my table have the username column which is the same with the Joomla! login 'username', do I have to link with the session or something else in the WHERE box?
**If I want to join another table, which the columns are similar with the previous table into the connection, what should I do in the join option ?
(because of some personal issues that the tables are done separated.)
This topic is locked and no more replies can be posted.