• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Table library and form input box

#1
[eluser]pisio[/eluser]
Hey evryone, Im here with my stupid question and my bad english.Sorry for that :d
I get from mysql results:
Code:
function getTopLinks() {
        $this->linksForEdit = $this->db->get('links');
        print_r($this->linksForEdit->result());
    }
That result :
Code:
Array ( [0] => stdClass Object ( [id] => 1 [url] => / [value] => Home [is_admin] => 0 [position] => 0 [visable] => 0 ) [1] => stdClass Object ( [id] => 2 [url] => # [value] => Created by Preslav Panayotov [is_admin] => 1 [position] => 1 [visable] => 0 ) [2] => stdClass Object ( [id] => 3 [url] => /users/index [value] => Login [is_admin] => 0 [position] => 0 [visable] => 1 ) [3] => stdClass Object ( [id] => 4 [url] => /users/register [value] => Register [is_admin] => 0 [position] => 0 [visable] => 1 ) [4] => stdClass Object ( [id] => 5 [url] => /users/logout [value] => Logout [is_admin] => 0 [position] => 0 [visable] => 2 ) [5] => stdClass Object ( [id] => 6 [url] => /video/random [value] => Random Video [is_admin] => 0 [position] => 0 [visable] => 0 ) [6] => stdClass Object ( [id] => 7 [url] => /video/upload [value] => Upload video [is_admin] => 0 [position] => 0 [visable] => 2 ) [7] => stdClass Object ( [id] => 8 [url] => /capanel/admin/index [value] => Admin Panel [is_admin] => 0 [position] => 1 [visable] => 3 ) [8] => stdClass Object ( [id] => 9 [url] => /capanel/admin/links [value] => Edit Links [is_admin] => 1 [position] => 0 [visable] => 3 ) )


And I'm printing table with :
Code:
echo $this->table->generate($this->AdminEditLinks->linksForEdit);
http://index.web-tourist.net/wp-content/...itled1.png

Its cool. But here it is my question:
How i can make input with name url / value / is_admin / position / visable?
I dont wanna make it with foreach and make for everyone inputbox.
Thank you in advance.

#2
[eluser]theprodigy[/eluser]
are you asking how you can remove the id column from the table and leave the rest of the columns?

#3
[eluser]pisio[/eluser]
No, To add for evryrow input text box.

#4
[eluser]theprodigy[/eluser]
Quote:I dont wanna make it with foreach and make for everyone inputbox.

I don't think you can do this without using a foreach, unless you wanna do it in a way that is not really all that wise, and change your query to include returning text for that column.

Code:
select '<input type="text" name="whatever" />' as input, url, value, is_admin, position, visible
from links

#5
[eluser]pisio[/eluser]
thx


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.