[Problem] HTML Table Class - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [Problem] HTML Table Class (/showthread.php?tid=11547) Pages:
1
2
|
[Problem] HTML Table Class - El Forum - 09-12-2008 [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? [Problem] HTML Table Class - El Forum - 09-13-2008 [eluser]Sumon[/eluser] Here goes your controller Code: $this->load->model('test_model'); and here is your model Code: function all_images() [Problem] HTML Table Class - El Forum - 09-13-2008 [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/thumb_1f0fda9941769b417d2b87625fbdc357.jpg While the images are in: http://127.0.0.1/CI/images [Problem] HTML Table Class - El Forum - 09-13-2008 [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. [Problem] HTML Table Class - El Forum - 09-13-2008 [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) [Problem] HTML Table Class - El Forum - 09-13-2008 [eluser]Sumon[/eluser] i think, view is a reserver word of CI so try by changing this function name. instead you can use display [Problem] HTML Table Class - El Forum - 09-13-2008 [eluser]Sein Kraft[/eluser] I've change the function name but shows the same error. [Problem] HTML Table Class - El Forum - 09-13-2008 [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); [Problem] HTML Table Class - El Forum - 09-13-2008 [eluser]Sein Kraft[/eluser] Now yes x3, but appear an error in the sql query: Quote:A Database Error Occurred Code: function view($data) [Problem] HTML Table Class - El Forum - 09-13-2008 [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) |