I found the data under _users_fields_values.
How can I pull just the information for the field I need for the posting user?
There are 4 different fields per user. Please forgive me, I'm a begginer =)
Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Wed Nov 26, 2008 10:51 pm
Without looking I don't know the structure of the custom fields. But It is kind of hard to understand what you are asking. Maybe one of the guys that worked on the new YA will be able to answer this.
What you are sating would make complete since of the Custom info was stored under the _user table. But alas, it is stored in its own _users_fields_values table. It appears it will take an advanced query to get the correct info queried to use for the postrow.
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Thu Nov 27, 2008 8:43 am
Well, you need to know which 'fid' values are for the custom fields that you added. You can get those from _users_fields and then you already have the user_id for the user, so you can use that for 'uid' and now you should be able to fashion a query against _users_fields_values to get the values you want.
well now that i found some info, please forgive me for what i requested =)
I can see the scope is huge!
I need to do some learning, but this seems to be a start:
$result = mysql_query("SELECT * FROM nuke_users_field_values
WHERE uid='48' AND fid='1'")
or die(mysql_error());
// store the record of the "example" table into $row
$row = mysql_fetch_array( $result );
// Print out the contents of the entry
echo $row['uid']." - ".$row['value'];
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Sun Jan 25, 2009 9:18 am
It does take some SQL and PHP language skills to do, yes. I would suggest getting yourself a MySQL book and a basic PHP book, as I am sure you will want to do more hacking of code (customization) in the future.
Enjoy the road of learning. I sure have. We cannot necessarily take the time to write the code for you, but if you get stuck down the road, we'll try and help as you progress along this journey.
Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Sun Jan 25, 2009 12:22 pm
Just to give you a few hints. If you where just writing sql statements in pure php you would use mysql_query and mysql_fetch_array, but since we are writing in php nuke you need to use $db->sql_query and $db->sql_fetchrow. They will probably both work, but that is what you want.
Code:
$result = mysql_query("SELECT * FROM nuke_users_field_values
WHERE uid='48' AND fid='1'")
or die(mysql_error());
You are going to just want to select all fields with a uid equal to the user in question. You do not want to use where fid='1'. You want to select them all with one statement and then read them with a while loop.
Well, i'm trying to play with some code to figure out how to pull the results from each fid. I have to specify the fid in the query to get the correct value to display. I can't get it to display correctly in my table though any suggestions or any links to where I can read up on my problem?
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum