CodeIgniter Forums
Help with GET - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25)
+--- Thread: Help with GET (/showthread.php?tid=73581)



Help with GET - Germanikus - 05-12-2019

Hello, everybody,
I have a problem with the GET.
I want to transfer three values where two values are present or not (where_or).
But somehow none of the values are transferred and I don't know why.

IMG:
https://screenshots.firefox.com/g6qcToRnhwx1gftS/127.0.0.1

Controller:
PHP Code:
        public function index($slug) {
            
$url 'edition/index';
            
$array explode ('/',$url);
            
$data['array'] = $array[0];
            
$data['title'] = 'Edition Liste';
            
$data['edition_listes'] = $this->Edition_model->edition_listess($slug);
            
$this->load->view('templates/header'$data);
            
$this->load->view($url$data);
            
$this->load->view('templates/footer');
        }
        public function 
edition($tcg,$id,$short) {
            
$url 'edition/edition';
            
$array explode ('/',$url);
            
$data['array'] = $array[0];
            
$data['get_edition'] = $this->Edition_model->get_edition($tcg,$id,$short);
            
$this->load->view('templates/header'$data);
            
$this->load->view($url$data);
            
$this->load->view('templates/footer');
        } 

Model
PHP Code:
        public function edition_listess($slug) {
            
$this->db->select('*');
            
$this->db->from('db_edition');
            
$this->db->where('db_edition.tb_edition_tcg'$slug);
            
$this->db->order_by('db_edition.tb_edition_kurzel''ASC');
            
$this->db->order_by('db_edition.tb_edition_date''ASC');
            
$query $this->db->get();
            return 
$query->result_array();
        }
        public function 
get_edition($tcg,$id,$short) {
            
$this->db->select('*');
            
$this->db->from('db_edition');
            
$this->db->where('db_edition.tb_edition_tcg'$tcg);
            
$this->db->where('db_edition.tb_edition_id'$id);
            
$this->db->or_where('db_edition.tb_edition_kurzel'$short);
            
$this->db->order_by('db_edition.tb_edition_kurzel''ASC');
            
$this->db->order_by('db_edition.tb_edition_date''ASC');
            
$query $this->db->get();
            return 
$query->result_array();
        } 

index.php
Code:
<?php echo validation_errors(); ?>
<title><?php echo $title; ?></title>

<div class="row">
    <div class="col-xs-6 col-lg-1">
    </div>
    <div class="col-xs-6 col-lg-10">
<?php foreach ($edition_listes as $edition_liste): ?>
        <div class="list-group">
            <a href="<?php echo base_url(); ?>edition/edition/<?php echo $edition_liste['tb_edition_tcg'];?>/<?php if($edition_liste['tb_edition_kurzel'] > '') { echo $edition_liste['tb_edition_kurzel']; } else { echo $edition_liste['tb_edition_id']; } ?>" class="list-group-item list-group-item-action list-group-item-secondary">
                <div class="media">
                    <img class="media-object img-rounded img-responsive"  src="<?php echo base_url(); ?>/assets/images/display.png" alt="placehold.it/350x250">
                    <div class="media-body">
                        <h4 class="list-group-item-heading"><?php echo $edition_liste['tb_edition_name'];?></h4>
                            <p class="list-group-item-text">
                                <b>SET ID: </b><?php if($edition_liste['tb_edition_kurzel']): echo $edition_liste['tb_edition_kurzel']; endif; ?></br>
                                <b>Kartenmenge: </b><?php echo $edition_liste['tb_edition_size'];?></br>
                                <b>Release: </b>00.00.0000
                            </p>
                    </div>
                    <div class="col-md-3 text-right">
                        <h5 class="colors">Pre-Release: <button class="btn btn-primary"><i class="fa fa-check-square"></i></button></h5>
                        <h5 class="colors">Pre-Release: <button class="btn btn-primary"><i class="fa fa-square"></i></button></h5>
                    </div>
                </div>
            </a>
        </div>
<?php endforeach; ?>
    </div>
    <div class="col-xs-6 col-lg-1">
    </div>
</div>

edition.php (test page)
Code:
<?php echo validation_errors(); ?>
<?php echo $slug; ?>



RE: Help with GET - DELE - 05-12-2019

show the contents of your routes file, there might be an error there


RE: Help with GET - Wouter60 - 05-12-2019

Which "GET" do you mean? The this->db->get(), or php's super-global $_GET?
Please, give us an example of the complete url to call the edition/edition method with 3 values.


RE: Help with GET - InsiteFX - 05-13-2019

Where are you getting the $url from? You need to show more code and what type of get your using.

If your trying to pull these off of the url then you need to use CodeIgniter segment methods.