Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Add row to table using a checkbox


Recommended Posts

Hi all!


I've racked my brain for hours trying to figure this out and so far nothing.... hoping someone can shed some light on this for me.


I've created a new table in the db called students. Now I'd like to add a checkbox in admin/customers.php that when checked automatically inserts the current customer into this table.

Here is what I've added to the top of customers.php around line 20:


if (isset($HTTP_POST_VARS['student'])) {
  $student = "INSERT INTO `students` SET (students_id, customers_id, students_pmodel, students_email, students_mod1, students_mod2, students_mod3, students_manual, students_cert, students_active) VALUES ('', '$_REQUEST[cID]', 'CBT-0100', '$_POST[customers_email_address]', '', '', '', '', '', '1')"; 
} else {



Then around line 700 I've added the checkbox like this:

	 <td><span class="formAreaTitle"><?php echo Student; ?></span></td>
	 <td class="formArea">
	   <table border="0" cellpadding="3" cellspacing="3">
		   <td class="main"><?php echo ENTRY_S_ACTIVE; ?></td>
		   <td class="main"><?php 
		   echo tep_draw_checkbox_field('student', '1') . ' ' . (tep_not_null(ENTRY_STUDENT_TEXT) ? '<span class="smallText">' . ENTRY_STUDENT_TEXT . '</span>': '');

			?> </td>


I'm able to see the checkbox... but when I check it and click update @ the bottom it doesn't add the info from line 20 into this table.

Any help with this would be appreciated. THX!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...