what wrong with this function |
[eluser]yudahebat[/eluser]
what wrong with this controller?? I have a controller like this Code: <?php and my view like this Code: <html>
[eluser]yudahebat[/eluser]
upss I forgot to explain my problem,Sorry... hehehe.. My problem is my controller didn't pass the $data into the views... if I write http://localhost/ci2/test/choose_data/15 on url its display nothing whats wrong??
[eluser]kgill[/eluser]
For future reference if you want help, explain what the problem is, posting a bunch of code and asking what's wrong with this is far less likely to get you help than you actually telling us what it's supposed to do and what it's doing instead. Offhand I'd say you're getting a blank page when you expect to see some data and that's because your index function sets a bunch of variables to '' and then echos them out so it's only going to show a blank page. If you call your choose_data function it selects a bunch of data and then tries to pass that to the index function. The problem is your index function doesn't take any parameters, so passing it one doesn't do anything and even if it did because the first thing that function does is set everything to '' whatever you passed in would be wiped out and you'd still end up with a blank page.
[eluser]Thorpe Obazee[/eluser]
[quote author="yudahebat" date="1238745254"]upss I forgot to explain my problem,Sorry... hehehe.. My problem is my controller didn't pass the $data into the views... if I write http://localhost/ci2/test/choose_data/15 on url its display nothing whats wrong??[/quote] Your index doesn't receive parameters from your choose data method.
[eluser]yudahebat[/eluser]
why it doesnt receive?? do you have any idea to fix this??
[eluser]Thorpe Obazee[/eluser]
[quote author="Colin Williams" date="1238749217"]http://us3.php.net/functions[/quote] ![]()
[eluser]TheFuzzy0ne[/eluser]
I always recommend that your index method doesn't accept any arguments. If you must pass arguments into your index method, you should call it in your URL like this: http://www.mysite.tld/controller_name/index/arg1/arg2 |
Welcome Guest, Not a member yet? Register Sign In |