SELECT
DISTINCT(tbl_forms.form_title) AS title,
tbl_forms.reference_code AS reference_code,
tbl_forms.tbl_form_id AS tbl_id,
tbl_forms.tbl_category_form_id AS tbl_category_id,
tbl_forms.short_description AS short_description,
tbl_category_form.cat_name AS cat_name,
tbl_forms.notes AS notes,
tbl_forms.about_doc AS about_doc,
tbl_forms.app_features AS app_features,
tbl_forms.user_type AS user_type,
tbl_category_form.description AS description,
tbl_jury.tbl_jury_id AS tbl_jury_id,
'form' AS type,
match(tbl_forms.form_title
,tbl_forms.short_description
,tbl_forms.notes
,tbl_forms.about_doc
,tbl_forms.app_features
,tbl_forms.reference_code
,tbl_forms.user_type
,tbl_category_form.cat_name
,tbl_category_form.description)
against ('' IN BOOLEAN MODE) AS relevance
FROM tbl_forms, tbl_category_form, tbl_jury, tbl_currency, tbl_jury_currency
WHERE
tbl_forms.tbl_category_form_id = tbl_category_form.tbl_category_form_id AND
tbl_jury.tbl_jury_id = tbl_category_form.tbl_jury_id AND
tbl_jury_currency.tbl_jury_id = tbl_category_form.tbl_jury_id AND
tbl_forms.tbl_category_form_id = tbl_category_form.tbl_category_form_id AND
match(tbl_forms.form_title
,tbl_forms.short_description
,tbl_forms.notes
,tbl_forms.about_doc
,tbl_forms.app_features
,tbl_forms.reference_code
,tbl_forms.user_type
,tbl_category_form.cat_name
,tbl_category_form.description)
against ('' IN BOOLEAN MODE)
AND
tbl_jury.tbl_jury_id=''
SELECT
DISTINCT(tbl_documents.document_title) AS title,
tbl_documents.reference_code AS reference_code,
tbl_documents.tbl_document_id AS tbl_id,
tbl_documents.tbl_category_document_id AS tbl_category_id,
tbl_documents.short_description AS short_description,
tbl_category_document.cat_name AS cat_name,
tbl_documents.notes AS notes,
tbl_documents.about_doc AS about_doc,
tbl_documents.app_features AS app_features,
tbl_documents.user_type AS user_type,
tbl_category_document.description AS description,
tbl_jury.tbl_jury_id AS tbl_jury_id,
'doc' AS type,
match(tbl_documents.document_title
,tbl_documents.short_description
,tbl_documents.notes
,tbl_documents.about_doc
,tbl_documents.app_features
,tbl_documents.reference_code
,tbl_documents.user_type
,tbl_category_document.cat_name
,tbl_category_document.description)
against ('' IN BOOLEAN MODE) AS relevance
FROM tbl_documents, tbl_category_document, tbl_jury, tbl_currency, tbl_jury_currency
WHERE
tbl_documents.tbl_category_document_id = tbl_category_document.tbl_category_document_id AND
tbl_jury.tbl_jury_id = tbl_category_document.tbl_jury_id AND
tbl_jury_currency.tbl_jury_id = tbl_category_document.tbl_jury_id AND
match(tbl_documents.document_title
,tbl_documents.short_description
,tbl_documents.notes
,tbl_documents.about_doc
,tbl_documents.app_features
,tbl_documents.reference_code
,tbl_documents.user_type
,tbl_category_document.cat_name
,tbl_category_document.description)
against ('' IN BOOLEAN MODE)
AND
tbl_jury.tbl_jury_id=''