I created a form with DBRead:
Now the problem is, if a not registered user opens the form, he gets information of another (not registered) user filled the form before.
How can I give the not registered users an emty form?
Thanks for help.
<?php
$user = JFactory::getUser();
return array("user_id" => $user->get("id"));
?>
Now the problem is, if a not registered user opens the form, he gets information of another (not registered) user filled the form before.
How can I give the not registered users an emty form?
Thanks for help.
Hi hcohl,
Please try this
Bob
Please try this
<?php
$user = \JFactory::getUser();
if ( $user->id > 0 ) {
return array( 'user_id' => $user->id );
} else {
return array( ": 'AAA' = 'ZZZ' " );
}
?>That should return an empty array for a guest.
Bob
Hallo Bob,
thank you for your answer.
But this returns error 1054 - Unknown column 'Data.AAA'.
What do I have to set for "AAA" and "ZZZ"?
HC Ohl
thank you for your answer.
But this returns error 1054 - Unknown column 'Data.AAA'.
What do I have to set for "AAA" and "ZZZ"?
HC Ohl
Hi hcohl,
Sorry, Not thinking clearly - I've updated this line
Bob
Sorry, Not thinking clearly - I've updated this line
return array( ": 'AAA' = 'ZZZ' " );you just need something there that returns no records.
Bob
This topic is locked and no more replies can be posted.
