查询自定义字段joomla

时间:2017-08-22 02:24:39

标签: mysql joomla

我在用户管理中添加了自定义字段,效果很好,自定义字段保存在字段 fields_values 表中,我找不到办法加入用户表用户表中的信息和一个查询结果中的字段表。

我需要这样的内容:$(document).ready(function(){ $('a.showImage').click(showImage); $('#imageContainer .close').click(hideImage); $('#clearForm').click(function(event) { clearForm(); event.preventDefault(); }); // prevent default action when user clicks a button /*$('input[type="submit"], button').each(function(index) { $(this).click(function(event) { //if ($(this) == $('input[type="submit"]')) if (index == 0) submitFormData(); event.preventDefault(); }); });*/ $('input[type="submit"]').click(function( event ) { event.preventDefault(); submitFormData(); }); $('#emailLink').click(emailLink); $('input[type="text"]').each(function() { var that = this; $(this).keyup(function(event) { // allow for 'submit' on enter button for any field if (event.key == 'Enter') { event.preventDefault(); submitFormData(); } // if this is a numberField, validate it like one else if ($(that).hasClass('numberField')) { // blacklisting again!! if ((!event.key.match(/[,.\d]/)) && (event.key != 'Tab')) { if (!$(that).hasClass('invalid')) $(that).addClass('invalid'); } // if user 'Backspace'd or 'Delete'd on something if ((event.key == 'Backspace') || (event.key == 'Delete')) { // make sure that only the allowed characters are in the field if ($(that).val().match(/^\d{1,3}\.?\d*$/)) { if ($(that).hasClass('invalid')) $(that).removeClass('invalid'); } } } }); }); })

我怎样才能做到这一点?

先谢谢了 奥斯卡

1 个答案:

答案 0 :(得分:0)

SELECT u.*, field_id as fid, value as fvalue FROM `#__users` as u  LEFT JOIN `#__fields_values` AS f ON u.id = f.item_id WHERE u.id=2

// u as user table
// f as fileds table
// u.id as userid (user table user id)
// f.item_id as userid (fields table user id)