Scaffolding problem with URL... |
[eluser]dr.fux[/eluser]
Hi there! I am new to CI and wanted try out the scaffolding thing as discribed in the video tutorials and de userguide... so i did the following: routes.php: Code: $route['scaffolding_trigger'] = "wwd_input"; main_controller jasse.php: Code: function Jasse() the database login data is in the config.php and works! i tested... when i load the page with the secred word (http://localhost/index.php/jasse/wwd_input) the main scaffolding page gets loaded correctly. But when i click on "Create New Record" i get to a wrong url: IS(wrong): http://localhost/index.php/jasse/jasse/wwd_input/add SHOULD: http://localhost/index.php/jasse/wwd_input/add when i load http://localhost/index.php/jasse/wwd_input/add manually, [without clicking the link], i get the right "Scaffolding: Add Data" page. i fill in the form an hit the insert button. unfortunately the form goes to the wrong place again (http://localhost/index.php/jasse/wwd_inp...put/insert) whats wrong? thanks for help!
[eluser]Michael Wales[/eluser]
Just for grins, try putting the scaffolding loader in a method named index() Personally, I've never used scaffolding, but I could where some issue may arise from it being in the constructor. Code: function Jasse() { Also, check to make sure your config.php is correct - particularly this line: Code: $config['base_url'] = "http://localhost/"; Access the site with the same URL and let us know how it works.
[eluser]dr.fux[/eluser]
[quote author="walesmd" date="1190833637"] Also, check to make sure your config.php is correct - particularly this line: Code: $config['base_url'] = "http://localhost/"; Access the site with the same URL and let us know how it works.[/quote] that was it! no http in base_url :S now i get another error: Quote:An Error Was Encountered dunno what problem there is... i write no special character to db. should work easy!
[eluser]Michael Wales[/eluser]
group is a reserved word for MySQL. It thinks you are about to say "GROUP BY fieldname," but when you don't it goes "wtf biotch?" If you weren't using scaffolding and this was your own query, you could surround that field with ticks (`) and everything would work fine - that's definitely something that needs to be suggested, I'll make a post. In the meantime, either change the name of that field or quit using scaffolding.
[eluser]dr.fux[/eluser]
:-) yeah unbelievable how fast this was solved! thx very much!
[eluser]Josh Giese[/eluser]
[quote author="Michael Wales" date="1190833637"] Also, check to make sure your config.php is correct - particularly this line: Code: $config['base_url'] = "http://localhost/"; Access the site with the same URL and let us know how it works.[/quote] This totally fixed my problem as well. Thank you for suggesting this fix. |
Welcome Guest, Not a member yet? Register Sign In |