Hi guys, I'm trying to add custom fields, about 200 actually, which get updated with different user actions. Everything works perfectly until I add my 138th field. After that, all of the fields that I have added disappear from the list of added fields and the php functions that previously worked to update the fields in the mysql database no longer work. Can someone please tell me if this is a common error with a solution or not? And also, if there is a way to add a number of custom fields with default values for the user in the mysql database and have them actually work as if added through the 'add fields' function? Thanks, JW
James, yes, there is limitation for number of fields in v3. However, I cannot believe you need 200 fields. I believe it can and it must be solved other way. Could you please describe your use case and provide sample of the fields? I will try to suggest you another solution.
Hi Alex, So I'm trying to have approximately 190 fields per user. And these fields will all start with a value of 0 but change to 1 once the user has visited a particular page. For example, once the user has visited page1, the value of a field in the database will change to 1 and the user will then be shown page2 and so forth. I have also tried creating the exact type of field in the mysql database but it does not show up under fields and it does not behave the same way, ie, these fields do not get updated by my php scripts like the ones created in the user admin page do. Could you please help me with this? Thanks, JW
Use an SQL field set to blob. You then store data like this 1,0,0,0 so array(0) =1, meaning that they opened the 1st post and array(1) = 0, meaning they havent opened the 2nd post. and so on. David
James, I'd also recommend to use separate table instead. For example PHP: <?php amDb()->query('CREATE TABLE ?_visits (member_id int not null, page_id int not null, unique (member_id, page_id))'); ?> then to check if user visited a page PHP: <?php$pageId = 111; // set current page id somehow, you know betterif (amDb()->selectCell( "SELECT member_id FROM ?_visits WHERE member_id=?d AND page_id=?d", $_SESSION['_amember_id'], $page_id)){ exit("You are already visited this page!");} else { // mark current page as visited amDb()->query("INSERT IGNORE INTO ?_visits SET member_id=?d, page_id=?d", $_SESSION['_amember_id'], $page_id);}?> and so on. It will be much more efficient than serialize/deserialize on each visit