• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
submit multiple inputs within a forloop in codeigniter

#11
Hey, Abdelrahman, that's great! It's so satisfying to finally solve a problem, isn't it? Smile

Thanks for coming back and reporting what happened. As for any help I provided, you are very welcome! This is what these forums are for. Smile
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
Reply

#12
(03-27-2015, 10:30 AM)RobertSF Wrote: Thank You RobertSF,
can i know where to insert
 // array_search returns the key associated with the value you search
$question_id = array_search('Save', $_POST);

// take away the starting S
$question_id = substr($question_id, 1);

as i did it in controllers i got error.

syntax error, unexpected '$question_id' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST)



PHP Code:
<input type="submit" name="<?php echo 'S' . $row->id; ?>" value="Save" /> 



PHP Code:
// array_search returns the key associated with the value you search
$question_id array_search('Save'$_POST);

// take away the starting S
$question_id substr($question_id1); 
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.