Voila je vais faire simple je me prends la tête depuis 3 jours sur une requête sql si une âme charitable voulait bien m'aider.
La requête comprend 4 tables dont je joins les descriptions si dessous.
Je développe un module Joomla pour le composant sobi2


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
-- La table sobi2_fields qui contient tous les champ perso que l'on peut créer depuis l'admin de joomla
 
CREATE TABLE IF NOT EXISTS `jos_sobi2_fields` (
  `fieldid` int(11) NOT NULL auto_increment,
  `fieldType` int(11) default NULL,
  `wysiwyg` tinyint(1) default NULL,
  `fieldDescription` text,
  `explanation` text,
  `is_free` tinyint(1) default NULL,
  `payment` double default NULL,
  `fieldChars` int(11) default NULL,
  `fieldRows` int(11) default NULL,
  `fieldColumns` int(11) default NULL,
  `preferred_size` int(11) default NULL,
  `CSSclass` text,
  `enabled` tinyint(1) default NULL,
  `isEditable` tinyint(1) default NULL,
  `is_required` tinyint(1) default NULL,
  `in_promoted` tinyint(1) default NULL,
  `in_vcard` tinyint(1) default NULL,
  `in_details` tinyint(1) NOT NULL,
  `position` int(11) default NULL,
  `in_search` int(2) NOT NULL,
  `with_label` tinyint(1) NOT NULL,
  `in_newline` tinyint(1) NOT NULL,
  `isUrl` int(2) NOT NULL,
  `checked_out` int(11) NOT NULL,
  `checked_out_time` datetime NOT NULL,
  `displayed` tinyint(1) NOT NULL,
  PRIMARY KEY  (`fieldid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=44 ;
 
 
-- La table sobi2_fields_data qui contient toutes les données de ces champs perso
 
CREATE TABLE IF NOT EXISTS `jos_sobi2_fields_data` (
  `id` int(11) NOT NULL auto_increment,
  `fieldid` int(11) default NULL,
  `data_txt` text,
  `data_bool` tinyint(1) default NULL,
  `data_int` int(20) default '0',
  `data_float` float default '0',
  `data_char` varchar(255) NOT NULL,
  `itemid` int(11) default NULL,
  `expiration` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `itemid` (`itemid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=182 ;
 
 
-- La table sobi2 item qui contient les entrées de l'annuaire
 
CREATE TABLE IF NOT EXISTS `jos_sobi2_item` (
  `itemid` int(11) NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `hits` int(11) default NULL,
  `visits` int(11) default NULL,
  `published` tinyint(1) default NULL,
  `confirm` tinyint(1) NOT NULL,
  `approved` tinyint(1) NOT NULL,
  `archived` tinyint(1) default NULL,
  `publish_up` datetime default NULL,
  `publish_down` datetime default NULL,
  `checked_out` int(11) default NULL,
  `checked_out_time` datetime NOT NULL,
  `ordering` int(11) default NULL,
  `owner` int(11) NOT NULL,
  `icon` varchar(200) NOT NULL,
  `image` varchar(200) NOT NULL,
  `background` varchar(100) default NULL,
  `options` text,
  `params` text,
  `ip` varchar(15) NOT NULL,
  `last_update` datetime NOT NULL,
  `updating_user` int(11) NOT NULL,
  `updating_ip` varchar(15) NOT NULL,
  `metakey` varchar(200) NOT NULL,
  `metadesc` text NOT NULL,
  PRIMARY KEY  (`itemid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
 
 
-- La table sobi2_language qui contient toutes les correspondances de langue du composant
 
CREATE TABLE IF NOT EXISTS `jos_sobi2_language` (
  `langKey` varchar(50) NOT NULL default '',
  `langValue` varchar(255) NOT NULL default '',
  `description` text,
  `sobi2Section` varchar(10) NOT NULL default '',
  `fieldid` int(11) default NULL,
  `sobi2Lang` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`langKey`,`sobi2Lang`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Si besoin je peux joindre des données d'exemple.

Donc mon probleme j'ai créé un champ perso premium sont jos_sobi2_language.langKey = field_prem sont jos_sobi2_language.langValue = Premium, sont jos_sobi2_language.fieldid = 43, sont jos_sobi2_fields_data.data_txt peut etre 0 ou 1.

J'ai donc besoin de recupérer les entrées de jos_sobi2_item que si le jos_sobi2_fields_data.data_txt = 1.

je ne sait pas si j'ai été bien clair.
Un peu d'aide svp
Un carambar pour le gagnant