[Problem] HTML Table Class |
[eluser]Sein Kraft[/eluser]
Hi, everybody...again I can't make a table with the rows using a query. I need obtain something like: Code: <table border="0" cellpadding="4" cellspacing="0"> Using something like the example code, but i can't do that =( Example code: Code: $images = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'); The example code cut automaticly the array in four colums. Model: Code: function view() Anybody can help me?
[eluser]Sumon[/eluser]
Here goes your controller Code: $this->load->model('test_model'); and here is your model Code: function all_images()
[eluser]Sein Kraft[/eluser]
Thank you, works fine, but the script search the image in the scrpt path, not in base path. Ex. http://127.0.0.1/CI/index.php/imageboard...bdc357.jpg While the images are in: http://127.0.0.1/CI/images
[eluser]Sumon[/eluser]
you can do it by changing in model Code: function all_images() however, this is not a good solution though. better solution is to use a config variable. right now dont have much time to search that. if anyone have an example please post here.
[eluser]Sein Kraft[/eluser]
Yes yes ^^, I only insert the file name, not the file path. Another fail... Quote:Fatal error: Call to a member function view() on a non-object in E:\server\htdocs\libelula\system\application\controllers\imageboard.php on line 38 This function show the image in a simple page like "http://www.example.com/imageboard/view/1" Controller: Code: function view($id) Code: function view($data)
[eluser]Sumon[/eluser]
i think, view is a reserver word of CI so try by changing this function name. instead you can use display
[eluser]Sein Kraft[/eluser]
I've change the function name but shows the same error.
[eluser]Sumon[/eluser]
did you load model name in controller? Code: $this->load->model('your_model_name'); Code: $this->your_model_name->view($some_value);
[eluser]Sein Kraft[/eluser]
Now yes x3, but appear an error in the sql query: Quote:A Database Error Occurred Code: function view($data)
[eluser]Pascal Kriete[/eluser]
Your where clause is wrong. SQL reads very much like a normal sentence. Right now it reads ... where 1 . Where 1 what? I think you're looking for ->where('id', $id) |
Welcome Guest, Not a member yet? Register Sign In |