Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2016
    Posts
    1

    Unanswered: Problems with SQL Coding

    I just need name to be captured without re entering it like i did in this coding
    <div class="form-group">
    <label class="col-sm-3 control-label"><?php echo get_phrase('class');?></label>
    <div class="col-sm-9">
    <select name="class_id" class="form-control"
    onchange="return get_class_students(this.value)">
    <option value=""><?php echo get_phrase('select_class');?></option>
    <?php
    $classes = $this->db->get('class')->result_array();
    foreach ($classes as $row):
    ?>
    <option value="<?php echo $row['class_id'];?>"><?php echo $row['name'];?></option>
    <?php endforeach;?>

    </select>
    </div>
    </div>

    <div class="form-group">
    <label class="col-sm-3 control-label"><?php echo get_phrase('student');?></label>
    <div class="col-sm-9">
    <select name="student_id" class="form-control" style="width:100%;" id="student_selection_holder">
    <option value=""><?php echo get_phrase('select_class_first');?></option>
    <input type="text" " name="name"/>
    </select>
    </div>
    </div>
    it worked however I do not want to type the name from the $row['name'] result how can I perfect this code without any form of manual entering of the name

  2. #2
    Join Date
    Sep 2016
    Location
    Pune
    Posts
    7
    Hii ,
    Programming in SQL can be both a fun and a challenging task. Those with a background in traditional programming languages such as Java, C, C++, and VB often find it difficult to adapt to the “set-based” mindset. Even seasoned SQL developers and DBAs can get trapped in one of the many pitfalls of the SQL language.

    Thank You !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •