The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
seeking php help, foreach with destinct selection [ sorted ]
got a table similar to this, just much larger
colum = autoinc for table columa and columb = unknown data columc is known data i can select with. But if i just SELECT * FROM my table WHERE columc=knownvalue the result will be an array i also need to run through a loop to display im going to print/echo via templates, <tables> and the template_bit ill be using will be something like <tr><td>{vb:raw DataG}</td><td>{vb:raw DataX} colum|columa|columb|columc -------+--------+--------+------- idfield| data1| dataG | data3 idfield| data1| dataF | data2 idfield| data1| dataH | data1 idfield| data2| dataG | data3 idfield| data2| dataF | data2 idfield| data2| dataH | data1 ------------------------------------- Now i want to display DataG from both places (or many more) where DataG is present but only once pr unique columA so first i get the unique columa's with sql $getunique = $vbulletin->db->query("SELECT DISTINCT columa FROM ".TABLE_PREFIX."mytable"); and now im stuck,, so im thinking maybe assign each unique id's with a id and then run a loop that collects the data for display forach ($getunique, ??what value??) { -- run the templater registers and renders.. } i hope its clear what im trying to do --------------- Added [DATE]1264287288[/DATE] at [TIME]1264287288[/TIME] --------------- adding code snipittet.. hope it helps to make sence what im trying to do PHP Code:
character name : testcharlie testcharlie but the second user, should have been testjohn and if more was added then ofcourse they should appear. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|