[Newbie] Need help to display results. |
Hi i am new in using codeigniter ihave this codes
This is my model Code: function select_qnum_query(){ this is my controller Code: function select_qnum(){ and this is my view Code: <script src ="<?php echo base_url("assets/js/jquery-3.4.1.min.js"); ?>"></script>
PHP Code: <?php echo base_url() ?> missing ; so make it base_url(); or use PHP Code: <?=base_url()?> pro novice
Your model uses result() that does not exis on $query object.
You should use getResult() instead. I also simplified your code a bit: PHP Code: function select_qnum_query() You could also benefit from AP Response Trait in your controller to get rid of echo, https://codeigniter4.github.io/userguide...onses.html
return $qb->select('qnum')->where("transaction", "landtax")->get()->getResult();
pro novice
Code: <script> Are you sure that you should not have a ready in your JavaScript? Code: $(document).ready(function () { You could put a var_dump('<pre>', $queryResult, '</pre>') in your model to see if you have any records. Even when using Ajax the browser will show the result for test. (03-10-2020, 03:40 PM)zahhar Wrote: Your model uses result() that does not exis on $query object. Still it doesn't run. Does it need ->from('tblkiosk')? I tried to put it but still no result. :( (03-11-2020, 10:23 AM)jvandemerwe Wrote:Still no result.
Where are your <head> and <body> tags your JavaScript should go just above your </body></html>
unless it is called first in your html then the scripts need to be in the <head></head> tags. How does jQuery know which button is being clicked? Code: <button id="btnSubmit">Payment</button> What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |