Get the value from DropDown list [RESOLVED] |
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 ="???????????????"');
Absolutely.
In your controller: PHP Code: $milestone_id = $this->input->post('milestone_id');
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 =" "')
12-03-2016, 12:06 PM
(This post was last modified: 12-04-2016, 08:22 AM by ivantcholakov. Edit Reason: fixing a small mistake ) Code: // JavaScript
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?
Send it where?
To your database? In a session variable? What do you want to do with the value of the input field?
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"
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.
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/da...index.html (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 |
Welcome Guest, Not a member yet? Register Sign In |