Ultimate Column GeneratorOne of the first things you learn with PHP is how to query the database and things rock on nicely provided there's only row of data being presented in each table row. But that's not real life and then you've got problems. Not big problems but the code can get messy and it's tricky for beginners. How the Ultimate Column Generator can helpThis function outputs an array of data with all the information required to process the table. In this example I've got alot of thngs being coded so that you can see how it works, but in reality all you need is the function called getColInfo() and you call it with
$colInfo = getColInfo(4);
or however many columns you require - because this will normally be hardcoded when you design your page. Then use the array as the example shows and you're up and running with clean, readable code which will be easy to maintain later on. Warning: include() [function.include]: open_basedir restriction in effect. File(/home/itamer/domains/itamer.com/dbsetup.php) is not within the allowed path(s): (/var/www/vhosts/itamer.com/httpdocs/:/tmp/) in /var/www/vhosts/itamer.com/httpdocs/muck/ultimate_columns.php on line 22 Warning: include(/home/itamer/domains/itamer.com/dbsetup.php) [function.include]: failed to open stream: Operation not permitted in /var/www/vhosts/itamer.com/httpdocs/muck/ultimate_columns.php on line 22 Warning: include() [function.include]: Failed opening '/home/itamer/domains/itamer.com/dbsetup.php' for inclusion (include_path='.:/usr/share/php') in /var/www/vhosts/itamer.com/httpdocs/muck/ultimate_columns.php on line 22 |