Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

using tabs table

hi all,

i have to produce a table with different tabs, 5 to be exact. the problem is i dont have a clue how to populate it with the data, actually i'm using jquery datatables , and uses laravel 4. i managed to get a json with the data i need.

but the problem is i have 1 big table and not filtered by the tab

could someone help with a link or explanation on how to populate the tabs ?

lets say i have 5 tabs , each tab is labeled as : 191 , 194, 197, 198, 199

any help plz ? :)

2 Answers

You need to use mysqli_fetch_array() to populate data from the mysql database.

Please check this as an example

http://www.w3schools.com/php/php_ajax_database.asp

i'm getting the data, np about that, i've formatted my data and i use a json to populate the dataTables.

the problem is i've generated a single json with all the data, my question is how to filter the data and push the data for 191 in it's tab and data for 194 in its tab etc... i dont know if i'm very clear...

do i have to generate a json for each tab or can i process the filtering with 1 single json ?