Get the value from DropDown list [RESOLVED] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Get the value from DropDown list [RESOLVED] (/showthread.php?tid=66788) Pages:
1
2
|
Get the value from DropDown list [RESOLVED] - Fraps900 - 12-02-2016 hi there, is there any possible to get the value (on live) from this: Code: <div class="form-group"> To this? Code: $result = mysql_query('SELECT SUM(estimated_hours) AS value_sum FROM project_has_tasks WHERE milestone_id ="???????????????"'); RE: Get the value from DropDown list - Wouter60 - 12-02-2016 Absolutely. In your controller: PHP Code: $milestone_id = $this->input->post('milestone_id'); RE: Get the value from DropDown list - Fraps900 - 12-03-2016 Thanks for help, but can You please tell me where exactly I could use above code, and how it should looks like in full? Sorry, I'm new in codeigniter I just need to get the value from chosen select ($milestone->id) to milestone_id =" "') RE: Get the value from DropDown list - ivantcholakov - 12-03-2016 Code: // JavaScript RE: Get the value from DropDown list - Fraps900 - 12-03-2016 Ok guys maybe this way. Can you help me to get/save/remember <?=$milestone->id;?>, and post this to another id? I have these numbers here Code: <?=$milestone->id;?> Code: <div class="row tab-pane fade" role="tabpanel" id="milestones-tab"> I have to save this in memory and transfer to this: Code: div class="row tab-pane fade" role="tabpanel" id="burndown-tab"> i could get this by: Code: <?php if(isset($milestone)){ ?> But How to send it? RE: Get the value from DropDown list - Wouter60 - 12-04-2016 Send it where? To your database? In a session variable? What do you want to do with the value of the input field? RE: Get the value from DropDown list - Fraps900 - 12-05-2016 I've put the values to the URL: Code: <a href="<?=base_url()?>burndown?id=<?=$milestone->id;?>&id22=<?=$milestone->name?>&id33=<?=$project->name;?>"data-toggle=""><i class="ion-ios-heart milestone__header__right__icon"></i></a> I got it like: Code: <?php echo $_GET["id"]; Thanks for the suggestions. It's working good Anyway Can you please tell me how put these values to Myssql querry? I have to use Code: <?php echo $_GET["id"];?> in Code: <?php Any suggestions? Just simple put there Code: $_GET["id"] Code: $id" RE: Get the value from DropDown list - Fraps900 - 12-05-2016 Ok done: I had to change the querry for: Code: $result = mysql_query("SELECT SUM(estimated_hours) AS value_sum FROM project_has_tasks WHERE milestone_id ='$sum1'"); CASE CLOSED. RE: Get the value from DropDown list [RESOLVED] - Wouter60 - 12-05-2016 The solution you've found, has nothing to do with CodeIgniter. If you set up CI correctly, you can use the Query Builder to make it a lot easier: PHP Code: $sum1 = $this->input->get('id'); $this->db is the database connection CodeIgniter is using. Please read the Database Reference: http://www.codeigniter.com/userguide3/database/index.html RE: Get the value from DropDown list [RESOLVED] - Fraps900 - 12-07-2016 (12-05-2016, 11:39 PM)Wouter60 Wrote: The solution you've found, has nothing to do with CodeIgniter. Thanks Wouter60. Work the same and related to Codeigniter |