Hi, I want to add a new select box on new user page.
First I created a new table called pp_classes
Then I opened admin_user.php and added this line
$ppClasses = get_db_values("SELECT classID,className FROM pp_classes where startdate > now() ORDER BY classID ", array(array("", SELECT_COUNTRY_MSG)));
so far so good (except that the SELECT_COUNTRY_MSG is wrong, i know)
but when i go down the page and add this line:
$r->add_select("classes", TEXT, $ppClasses, "");
I get an error in the page which reads:
Block 'classes' doesn't exists.
So obviously I need to declare this Block somewhere else. Can anyone point me to where this might be?
Thanks
donna
3 Oct 2007 12:44 AM
OK, i figured this part out (for anyone else wondering the same thing, you have to add some html in the html template of the same name, for this to work)
Next prob is that when I submit the page, i get the following error
INSERT INTO va_users (is_approved,user_type_id,friendly_url,affiliate_code,tax_free,discount_type,discount_amount,merchant_fee_type,merchant_fee_ amount,affiliate_commission_type,affiliate_commission_amount,login,password,name,first_name,last_name,company_id,company_name, email,address1,address2,city,province,state_code,zip,country_code,phone,daytime_phone,evening_phone,cell_phone,fax,personal_ image,delivery_name,delivery_first_name,delivery_last_name,delivery_company_id,delivery_company_name,delivery_email,delivery_ address1,delivery_address2,delivery_city,delivery_province,delivery_state_code,delivery_zip,delivery_country_code,delivery_ phone,delivery_daytime_phone,delivery_evening_phone,delivery_cell_phone,delivery_fax,class,paypal_account,tax_id,short_ description,full_description,registration_date,registration_ip,modified_date,modified_ip,last_visit_ip) VALUES (1,'1','','',0,NULL,NULL,NULL,NULL,NULL,NULL,'ddddd','ddddd','ddddd','','',NULL,NULL,'dd@dd.com','ddd',NULL,'ddddd',NULL,NULL, '2133','AU',NULL,'97979797','97979797',NULL,NULL,NULL,'ddddd',NULL,NULL,NULL,NULL,'dd@dd.com','ddd',NULL,'ddddd',NULL,NULL, '2133','AU',NULL,NULL,NULL,NULL,NULL,'2',NULL,NULL,NULL,NULL,'2007-10-03 09:37:23','127.0.0.1','2007-10-03 09:37:23','127.0.0.1',NULL)
MySQL Error: Unknown column 'class' in 'field list'
This is obviously because there is no field 'class' in the va_users table.
What I want to do though, is grab the user id of the new user, the class value, and insert them both in a new table, nominally named pp_user_classes
But because it is all wrapped up with the user data, can't do at present.
Could someone please explain to me how this might be done?