how to pass data to view?? |
[eluser]Thorpe Obazee[/eluser]
[quote author="yudahebat" date="1238750030"]No. I have it on my DB[/quote] what is on your db? I suggest you read the user_guide really well.
[eluser]yudahebat[/eluser]
mission six it still error Code: A PHP Error was encountered and another 3 error
[eluser]yudahebat[/eluser]
Code: what is on your db? this my db its call mrputucar and the tabel call testimonial Code: id testimonial | tanggal | email | nama | isi| but its still didnt display on my view I've load my database also on autoload function
[eluser]Thorpe Obazee[/eluser]
Post what you have now... controller and view.
[eluser]yudahebat[/eluser]
this my controller Code: <?php this my view Code: <html> when I write Code: http://localhost/ci2/test/choose_data/15 its produce Code: Fatal error: Cannot use object of type stdClass as array in C:\xampp\htdocs\CI2\system\application\controllers\test.php on line 11 any idea??
[eluser]Thorpe Obazee[/eluser]
Code: <?php this should do it.
[eluser]missionsix[/eluser]
Hmm, sorry my example didn't work, I didn't test it... why not just use Code: $this->load->view('testpage',$viewdata); in the choose_data function? I don't see why you need to route your data from /Test/choose_data through index? If the views are the same, you could write a simple display function eg: Code: class Test extends Controller And then call $this->_display($data) instead of $this->index() to display your page? The error is really telling you what you need to know. Look at the line number in your code, and interpret the error accordingly...
[eluser]yudahebat[/eluser]
it works.... if I call Code: http://localhost/ci2/test/choose_data/4 but if I call Code: http://localhost/ci2/test how can I display index.php if I didnt choose database from choose_data function??
|
Welcome Guest, Not a member yet? Register Sign In |