Welcome Guest, Not a member yet? Register   Sign In
Community Auth
#17

[eluser]kacyblack[/eluser]
Another one is here, Am trying to alter the database table colums in other for it to contain more information like Phone, Language, Date of Birth etc and firstly I added more form fields in the Registration Form php file that is
Code:
registeration_form.php
like this:

Code:
<?php
      // DATE OF BIRTH LABEL AND INPUT ***********************************
      echo form_label('Date Of Birth','dob',array('class'=>'form_label'));
#      echo input_requirement('*');
      $input_data = array(
       'name'  => 'dob',
       'id'  => 'dob',
       'class'  => 'rform_input dob',
       'value'  => set_value('dob'),
       'placeholder'  => ('Date Of Birth: Day/Month/Year'),
       'required'  => ('required'),
       'maxlength' => '20',
      );

      echo form_input($input_data);

     ?>
                    
                    
                    
                                             <?php
      // LANGUAGE LABEL AND INPUT ***********************************
      echo form_label('Language','language',array('class'=>'form_label'));
#      echo input_requirement('*');
      $input_data = array(
       'name'  => 'language',
       'id'  => 'language',
       'class'  => 'rform_input language',
       'value'  => set_value('language'),
       'placeholder'  => ('Language'),
       'required'  => ('required'),
       'maxlength' => '20',
      );

      echo form_input($input_data);

     ?>
                    
                    
                    
                         <?php
      // PHONE NUMBER LABEL AND INPUT ***********************************
      echo form_label('Phone Number','user_phone',array('class'=>'form_label'));
#      echo input_requirement('*');
      $input_data = array(
       'name'  => 'user_phone',
       'id'  => 'user_phone',
       'class'  => 'rform_input user_phone',
       'value'  => set_value('user_phone'),
       'placeholder'  => ('Phone Number'),
       'required'  => ('required'),
       'maxlength' => '20',
      );

      echo form_input($input_data);

     ?>



SECONDLY I ALSO ALTERED
Code:
registration_model.php
like this:


Code:
// Create insert array for registration record
   $insert_array = array(
    'reg_id'         => $registration_id,
    'reg_time'       => time(),
    'user_name'      => set_value('user_name'),
    'user_pass'      => $this->encrypt->encode( $user_salt . set_value('user_pass') ),
    'user_salt'      => $user_salt,
    'user_email'     => set_value('user_email'),
    'first_name'     => set_value('first_name'),
    'last_name'      => set_value('last_name'),
    'street_address' => set_value('street_address'),
    'city'           => set_value('city'),
    'state'          => set_value('state'),
    'zip'            => set_value('zip'),
    'user_phone'     => set_value('user_phone'),
    'dob'            => set_value('dob'),
    'language'       => set_value('language'),
    'user_amount'    => set_value('user_amount'),
   );

   // Insert record
   $this->db->insert( config_item('temp_reg_data_table'), $insert_array );

   if( $this->db->affected_rows() > 0 )
   {
    return $registration_id;
   }
  }



AND LASTLY I UPDATED THE DATABASE TABLE TO INCLUDE THESE VARIABLES ALSO: Like this:


1. temp_registration_data table

2. user table


and I tried to register a new user and the registration was successful but the newly entered data did not show up in the tables after a successful registration, please what am I missing or what am I doing wrong or what am i not doing?

Thanks


Messages In This Thread
Community Auth - by El Forum - 08-23-2009, 09:45 PM
Community Auth - by El Forum - 01-30-2012, 05:03 PM
Community Auth - by El Forum - 02-21-2014, 01:13 AM
Community Auth - by El Forum - 02-21-2014, 02:02 PM
Community Auth - by El Forum - 02-24-2014, 09:05 AM
Community Auth - by El Forum - 02-24-2014, 10:13 AM
Community Auth - by El Forum - 02-24-2014, 10:51 AM
Community Auth - by El Forum - 02-24-2014, 03:29 PM
Community Auth - by El Forum - 02-24-2014, 04:51 PM
Community Auth - by El Forum - 02-25-2014, 06:36 AM
Community Auth - by El Forum - 02-25-2014, 08:44 AM
Community Auth - by El Forum - 02-26-2014, 12:23 PM
Community Auth - by El Forum - 02-27-2014, 01:28 AM
Community Auth - by El Forum - 02-27-2014, 01:30 AM
Community Auth - by El Forum - 02-27-2014, 07:10 AM
Community Auth - by El Forum - 02-27-2014, 07:34 AM
Community Auth - by El Forum - 02-27-2014, 07:46 AM
Community Auth - by El Forum - 02-28-2014, 09:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB