Assiging records to users

2 posts by 2 authors in: Forums > CMS Builder
Last Post: April 11, 2014   (RSS)

By Chris - April 11, 2014

Hi Paul,

Instead of "get options from database (advanced)", you can use "get options from MySQL query (advanced)" and insert the current user's num into the WHERE clause, like this:

SELECT num, title
  FROM `<?php echo $TABLE_PREFIX ?>every_field_multi`
  <?php if (!$CURRENT_USER['isAdmin']): ?>
    WHERE createdByUserNum = '<?php echo $CURRENT_USER['num'] ?>'
  <?php endif ?>

This way, the only list items returned are the ones which the current user owns. Does that do what you want?

See also the screenshot I've attached.

All the best,
Chris