Log in

View Full Version : $bbuserinfo and customfields


Pseudomizer
05-08-2004, 11:53 PM
Hello @LL,

i need a little help to finish my new hack.

The problem i have is $customfields. In the DB there is a table called userfield which has all the definitions for customfields but NOT the actual data. I can get the data with $bbuserinfo($profilefield['birthday']) but i would like to access this without a specific userid. I would like to read out all birthday fields, locations, etc from each user.

At the moment i can only read the data with:

select field28 from userfield order by userid;

But this will not work for all people because field28 will not always be field28. If someone creates a new profilefield he will get the next number which is available. So my script will fail in 90% of the cases. I would like to prevent this.

Is there a way to optimize this please ?

Any help is appreciated.

Cheers,

Xenon
05-09-2004, 10:24 AM
i think you have to do it via two queries then:


$field = $DB_site->query_first("SELECT profilefieldid FROM profilefield WHERE title = 'Birthday'");

$info = $DB_site->query("SELECT field" . $field['profilefieldid'] . " FROM.....

Pseudomizer
05-09-2004, 11:33 AM
I will try this. Thanks for your help. Let's see if it works for my new hack.

Cheers,